-
Notifications
You must be signed in to change notification settings - Fork 0
Syntax
#help
Opens the Racket-Lite online help for functions supported by the language in the current version.
#loadFile
Loads/Reads a Racket (*.rkt) file and interprets it.
#clear
Clears the Racket-Lite window.
(define (name [variable] [variable] ...) [expression])
Defines a function named name. The expression is the body of the function. When the function is called, the values of the arguments are inserted into the body in place of the variables. The function returns the value of that new expression.
The function name’s cannot be the same as that of another function or variable.
(define name [expression])
Defines a variable called name with the value of expression. The variable name’s cannot be the same as that of another function or variable, and the name itself must not appear in expression.
(if [question-expression]
[then-answer-expression]
[else-answer-expression])
When the value of question-expression is #true, if evaluates and/or returns the then-answer-expression. When the value of question-expression is #false, if evaluates and/or returns the else-answer-expression. If the question-expression is neither #true nor #false, if reports an error.
(local [definition-expression] [expression])
Groups related definitions for use in the following )expression. Each definition can be either define or define-struct. When evaluating local, each definition is evaluated in order, and finally, the body expression is evaluated. Only the expressions within the local (including the right-hand-sides of the definitions and the expression) may refer to the names defined by the definitions. If a name defined in the local is the same as a top-level binding, the inner one “shadows” the outer one. That is, inside the local, any references to that name refer to the inner one.