You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
anything other than one of the symbols `if`, `set!`, `define`, |
80
-
`lambda`, `begin`, or `quote` then it is treated as a procedure. It is |
81
-
evaluated using the same rules defined here. All the expressions |
82
-
are evaluated as well, and then the procedure is called with the list |
83
-
of expressions as arguments. |
84
-
Example: <`(square 12) => 144 |
39
+
|[variable reference](http://www.schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z-H-7.html#%_sec_4.1.1)|_var_| A symbol is interpreted as a variable name; its value is the variable's value. Example: `x`|
40
+
|[constant literal](http://www.schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z-H-7.html#%_sec_4.1.2)|_number_| A number evaluates to itself. Example: `12`|
41
+
|[quotation](http://www.schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z-H-7.html#%_sec_4.1.2)|`(quote exp)`| Return the _exp_ literally; do not evaluate it. Example: `(quote (a b c)) =>; (a b c)`|
42
+
|[conditional](http://www.schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z-H-7.html#%_sec_4.1.5)|`(if _test conseq alt_)`| Evaluate _test_; if true, evaluate and return _conseq_; otherwise evaluate and return _alt_. Example: `(if (< 10 20) (+ 1 1) (+ 3 3)) => 2`|
43
+
|[assignment](http://www.schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z-H-7.html#%_sec_4.1.6)|`(set! _var exp_)`| Evaluate _exp_ and assign that value to _var_, which must have been previously defined (with a `define` or as a parameter to an enclosing procedure). | Example: `(set! x2 (* x x))`|
44
+
|[definition](http://www.schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z-H-8.html#%_sec_5.2)|`(define var exp)`| Define a new variable in the innermost environment and give it the value of evaluating the expression _exp_. Examples: `(define r 3)` or `(define square (lambda (x) (* x x)))`|
45
+
|[procedure](http://www.schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z-H-7.html#%_sec_4.1.4)|`(lambda (_var..._) exp)`| Create a procedure with parameter(s) named _var..._ and the expression as the body. Example: `(lambda (r) (* r r))`|
46
+
|[sequencing](http://www.schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z-H-7.html#%_sec_4.2.3)|`(begin _exp..._)`| Evaluate each of the expressions in left-to-right order, and return the final value. Example: `(begin (set! x 1) (set! x (+ x 1)) (* x 2)) => 4 |
47
+
|[procedure call](http://www.schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z-H-7.html#%_sec_4.1.3)|`(_proc exp..._)`| If _proc_ is anything other than one of the symbols `if`, `set!`, `define`, `lambda`, `begin`, or `quote` then it is treated as a procedure. It is evaluated using the same rules defined here. All the expressions are evaluated as well, and then the procedure is called with the list of expressions as arguments. Example: <`(square 12) => 144 |
85
48
86
49
87
50
In this table, _var_ must be a symbol--an identifier such as x or square--and number must be an integer number,
0 commit comments