Difference between revisions of "SCI Programming Language/Introduction"

From SCI Wiki
Jump to navigationJump to search
(Created page with "Official SCI Documentation<br /> <div align="center"> Chapter: 1 | 2 | The...")
 
 
(39 intermediate revisions by the same user not shown)
Line 3: Line 3:
 
<div align="center">
 
<div align="center">
 
Chapter:  
 
Chapter:  
[[The Script Programming Language/Introduction|1]] |  
+
[[SCI Programming Language/Introduction|1]] |  
[[The Script Programming Language/Files|2]] |  
+
[[SCI Programming Language/Primitive Procedures|2]] |  
[[The Script Programming Language/Definitions|3]] |  
+
[[SCI Programming Language/Primitive_Procedures#Arithmetic_Primitives|3]] |  
[[The Script Programming Language/Data Types and Variables|4]] |  
+
[[SCI Programming Language/Primitive_Procedures#Boolean_Primitives|4]] |
[[The Script Programming Language/Primitive Procedures|5]] |  
+
[[SCI Programming Language/Primitive_Procedures#Assignment_Primitives |5]] |
[[The Script Programming Language/Control Flow|6]] |  
+
[[SCI Programming Language/Data Types and Variables|6]] |
[[The Script Programming Language/Procedures|7]] |  
+
[[SCI Programming Language/Definitions|7]] |
[[The Script Programming Language/Using SC|8]] |  
+
[[SCI Programming Language/Control Flow|8]] |  
[[The Script Programming Language/Index|Index]]
+
[[SCI Programming Language/Control Flow#Conditionals|9]] |  
 +
[[SCI Programming Language/Control Flow#Iteration|10]] |  
 +
[[SCI Programming Language/Procedures|11]] |
 +
[[SCI Programming Language/Files|12]] |  
 +
[[SCI Programming Language/Compiling SCI|13]] |  
 +
[[SCI Programming Language/Index|Index]]
 
</div><br />
 
</div><br />
  
<div align="center"><span style="font-size: 22pt">Introduction</span><br />
+
<div align="center"><span style="font-size: 22pt">Introduction to the SCI Programming Language</span><br />
 
''Author: [[Jeff Stephenson]]''</div>
 
''Author: [[Jeff Stephenson]]''</div>
  
 
&nbsp;
 
&nbsp;
 +
 +
The SCI language is an object-oriented language with a Lisp-like syntax. It is compiled by the sc compiler into p-machine code which is used by the interpreter, sci.exe. We will begin our discussion of the language with its basic Lisp-like characteristics, then go on to the object-oriented parts of the language. Like Lisp, SCI is based on parenthesized expressions which return values. An expression is of the form:
 +
 +
<blockquote><code>(procedure [parameter parameter...])</code></blockquote>
 +
 +
The parameters to a procedure may themselves be expressions to be evaluated, and may be nested until you lose track of the parentheses. Unlike Lisp, a procedure itself may not be the result of an evaluation. An example of an expression is:
 +
 +
<blockquote><code>(+ (-y 2) (/ x 3))</code></blockquote>
 +
 +
which would be written in infix notation as:
 +
 +
<blockquote>(y -2) + (x / 3)</blockquote>
 +
 +
All expressions are guaranteed to be evaluated from left to right. Thus,
 +
 +
<blockquote>
 +
<code>(= x 4)</code><br />
 +
<code>(= y (/ (+= x 4) ( / = x 2)))</code>
 +
</blockquote>
 +
 +
will result in y = 2 and x = 4.
 +
 +
Comments in SCI begin with a semicolon and continue to the end of the line.
 +
 +
[[The SCI Programming Language | Table of Contents]]
 +
 +
<span style="float: left">[[SCI Programming Language|&lt; Previous: Table of Contents]]</span>
 +
<span style="float: right">[[SCI Programming Language/Primitive Procedures|Next: Primitive Procedures &gt;]]</span>
 +
 +
&nbsp;
 +
 +
[[Category:SCI Documentation]]
 +
[[Category:SCI32]]
 +
[[Category:Scripting]]

Latest revision as of 21:45, 24 May 2016

Official SCI Documentation

Chapter: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | Index


Introduction to the SCI Programming Language
Author: Jeff Stephenson

 

The SCI language is an object-oriented language with a Lisp-like syntax. It is compiled by the sc compiler into p-machine code which is used by the interpreter, sci.exe. We will begin our discussion of the language with its basic Lisp-like characteristics, then go on to the object-oriented parts of the language. Like Lisp, SCI is based on parenthesized expressions which return values. An expression is of the form:

(procedure [parameter parameter...])

The parameters to a procedure may themselves be expressions to be evaluated, and may be nested until you lose track of the parentheses. Unlike Lisp, a procedure itself may not be the result of an evaluation. An example of an expression is:

(+ (-y 2) (/ x 3))

which would be written in infix notation as:

(y -2) + (x / 3)

All expressions are guaranteed to be evaluated from left to right. Thus,

(= x 4)
(= y (/ (+= x 4) ( / = x 2)))

will result in y = 2 and x = 4.

Comments in SCI begin with a semicolon and continue to the end of the line.

Table of Contents

< Previous: Table of Contents Next: Primitive Procedures >