(quote (datum)) -> <list>
'(datum) -> <list>
(operator operand1 ...) -> <object>
(lambda formals body) -> <procedure>
(define (name arg ...) body) -> #undefined
(define variable expr) -> #undefined
(set! variable expr) -> #undefined
(if test when-true when-false) -> <object>
(if test when-true) -> <object>
(while test body) -> <object>
(begin expr ...) -> <object>
QScheme make a strong distinction between define and set!. define creates a new symbol in the current environment and binds a value to it, set! does not create any symbol. Setting a value to an undefined symbol will cause an error. This distinction is needed especialy for the external variable. 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
(cond clause1 clause2 ...) -> <object>
(and test1 ...) -> <object>
(or test1 ... ) -> <object>
(case key clause1 clause2 ...) -> <object>
(let binding body) -> <object>
(let* binding body) -> <object>
(letrec binding body) -> <object>
(begin expr1 expr2 ...) -> <object>
(do ((var1 init1 step1 ) ... ) (test
expr ... ) command ...) -> <object>
(let var bindings body) -> <object>
(delay expr) -> <object>
(quasiquote (template)) -> <object>
`(template)) -> <object>
QScheme introduce a new form of lambda and define syntax:
(define (func formal [:opt var ] [:local local-vars])body) -> #undefined
The formal parameters are just like in standard Scheme. The optionnal part ':opt var' can be used to an optionnal variable and the ':local local-vars' part is used to create local variables. For example:
and
The define special form also uses the same convention, so you should be able to say:
(tst 10 20)
=> 30