QScheme accepts the standard ';' character as standard comment marker. Anything following the ';' character on the line is ignored.
QScheme also reconizes '#!' followed by anything except a letter as comment. For example:
#!/this also
#!This not
QScheme is case sensitive: define is not the same as DEFINE. Generally this should not be a problem. At a certain level, QScheme has to be case sensitive - when referencing entities defined in external libraries, for instance. It is for this reason that I chose to make QScheme globally case sensitive. If this causes too much trouble, contact me. It should be possible to write a compatibility mode.
QScheme recognizes the following tokens as valid keywords:
(keyword-display-type n) -> n
Change the way keywords are displayed. For example:
> :ake
> (keyword-display-type 1) :ake
> #!ake
> (keyword-display-type 2) :ake
> ake:
QScheme introduce a new form of the lambda and define syntax:
(define (func formal [:rest var ] [:local local-vars])body) -> #undefined
The formal parameters are just like in standard Scheme. The optional part ':rest var' can be used to introduce an optional variable and the ':local local-vars' part is used to create local variables. For example:
and
The define special form uses the same conventions, so you should be able to say:
(tst 10 20)
=> 30
QScheme makes a strong distinction between define and set!. define creates a new symbol in the current environment and binds a value to it; set! never creates any symbol. Setting a value to an undefined symbol will cause an error. This distinction is needed especially for the external variables. There, you have to use define to create a new symbol and bind the symbol to the external variable location and set! to assign a new value to the external variable. Example:
testvar-b
=> 10
(set! testvar-b 20) testvar-b
=> 20