Difference between revisions of "SCI Programming Language/Introduction"
Line 5: | Line 5: | ||
[[The SCI Programming Language/Introduction|1]] | | [[The SCI Programming Language/Introduction|1]] | | ||
[[The SCI Programming Language/Primitive Procedures|2]] | | [[The SCI Programming Language/Primitive Procedures|2]] | | ||
− | [[The SCI Programming Language/Arithmetic Primitives|3]] | | + | [[The SCI Programming Language/Primitive Procedures#Arithmetic Primitives|3]] | |
− | [[The SCI Programming Language/Boolean Primitives|4]] | | + | [[The SCI Programming Language/Primitive Procedures#Boolean Primitives|4]] | |
− | [[The SCI Programming Language/Assignment Primitives |5]] | | + | [[The SCI Programming Language/Primitive Procedures#Assignment Primitives |5]] | |
[[The SCI Programming Language/Data Types and Variables|6]] | | [[The SCI Programming Language/Data Types and Variables|6]] | | ||
[[The SCI Programming Language/Definitions|7]] | | [[The SCI Programming Language/Definitions|7]] | | ||
[[The SCI Programming Language/Control Flow|8]] | | [[The SCI Programming Language/Control Flow|8]] | | ||
− | [[The SCI Programming Language/Conditionals|9]] | | + | [[The SCI Programming Language/Control Flow#Conditionals|9]] | |
− | [[The SCI Programming Language/Iteration|10]] | | + | [[The SCI Programming Language/Control Flow#Iteration|10]] | |
− | [[The SCI Programming Language/ | + | [[The SCI Programming Language/Procedures|11]] | |
[[The SCI Programming Language/Files|12]] | | [[The SCI Programming Language/Files|12]] | | ||
[[The SCI Programming Language/Compiling SCI|13]] | | [[The SCI Programming Language/Compiling SCI|13]] | |
Revision as of 20:47, 24 May 2016
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.
< Previous: Table of ContentsNext: Primitive Procedures >