Difference between revisions of "The Script Programming Language/Introduction"

From SCI Wiki
Jump to navigationJump to search
(Created page with "==<br /> Introduction == 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 whi...")
 
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==<br /> Introduction ==
+
[[Official SCI Documentation]]<br />
 +
 
 +
<div align="center">
 +
Chapter:
 +
[[The Script Programming Language/Introduction|1]] |
 +
[[The Script Programming Language/Files|2]] |
 +
[[The Script Programming Language/Definitions|3]] |
 +
[[The Script Programming Language/Data Types and Variables|4]] |
 +
[[The Script Programming Language/Primitive Procedures|5]] |
 +
[[The Script Programming Language/Control Flow|6]] |
 +
[[The Script Programming Language/Procedures|7]] |
 +
[[The Script Programming Language/Using SC|8]] |
 +
[[The Script Programming Language/Index|Index]]
 +
</div><br />
 +
 
 +
<div align="center"><span style="font-size: 22pt">Introduction</span><br />
 +
''Author: [[Jeff Stephenson]]''</div>
 +
 
 +
&nbsp;
  
 
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.
 
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.
Line 30: Line 48:
 
<div class="CodeBlockHeader">Code:</div>
 
<div class="CodeBlockHeader">Code:</div>
 
<syntaxhighlight lang="sci">
 
<syntaxhighlight lang="sci">
      (y - 2) + (x / 3).
+
(y - 2) + (x / 3)
 
</syntaxhighlight>
 
</syntaxhighlight>
 
</blockquote>
 
</blockquote>
Line 47: Line 65:
  
 
Comments in Script begin with a semi-colon, ';', and continue to the end of the line.
 
Comments in Script begin with a semi-colon, ';', and continue to the end of the line.
 +
 +
&nbsp;
  
 
;Notes
 
;Notes
Line 53: Line 73:
 
&nbsp;
 
&nbsp;
  
<span style="float: left"><span class="Inactive">&lt; Previous: Introduction</span></span><span style="float: right">[[The Script Programming Language/Files|Next: Files &gt;]]</span>
+
[[The Script Programming Language | Table of Contents]]
 +
 
 
&nbsp;
 
&nbsp;
 +
 +
<span style="float: left">[[The Script Programming Language |&lt; Previous: Table of Contents]]</span><span style="float: right">[[The Script Programming Language/Files|Next: Files &gt;]]</span>
 +
 +
&nbsp;
 +
 +
[[Category:SCI Documentation]]
 +
[[Category:Scripting]]

Latest revision as of 20:13, 2 December 2015

Official SCI Documentation

Chapter: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Index


Introduction
Author: Jeff Stephenson

 

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


 

Table of Contents

 

< Previous: Table of ContentsNext: Files >