Script Programming Language/Introduction: Difference between revisions
m 2 revisions imported |
No edit summary |
||
| Line 1: | Line 1: | ||
[[Official SCI Documentation]]<br /> | [[ Official SCI Documentation]]<br /> | ||
[[The Script Programming Language | Table of Contents]] | |||
| |||
<div align="center"> | <div align="center"> | ||
Chapter: | Chapter: | ||
| Line 12: | Line 13: | ||
[[The Script Programming Language/Using SC|8]] | | [[The Script Programming Language/Using SC|8]] | | ||
[[The Script Programming Language/Index|Index]] | [[The Script Programming Language/Index|Index]] | ||
</div | </div> | ||
<div align="center"><span style="font-size: 22pt">Introduction</span><br /> | <div align="center"><span style="font-size: 22pt">Introduction</span><br /> | ||
Revision as of 20:40, 25 December 2025
Official SCI Documentation
Table of Contents
The Script adventure game language is an object-oriented language with a Lisp-like syntax. It is compiled by the sc compiler into the pseudo-code which is used by the interpreter, sci.
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.
As is Lisp, Script is based on parenthesized expressions which return values. An expression is of the form
Code:(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, the procedure itself may NOT be the result of an evaluation. An example of an expression is
Code:(+ (- y 2) (/ x 3))
which would be written in infix notation as
Code:(y - 2) + (x / 3)
All expressions are guaranteed to be evaluated from left to right. Thus,
Code:(= x 4) (= y (/ (+= x 4) (/= x 2)))
will result in y = 2 and x = 4.
Comments in Script begin with a semi-colon, ';', and continue to the end of the line.
- Notes
< Previous: Table of ContentsNext: Files >