Although and, or and cond are advised to be macros by Common Lisp,
they are implemented as special forms in EusLisp to improve
the interpreting performance.
and {form}* [special]
-
-
Forms are evaluated from left to right until NIL appears.
If all forms are evaluated to non-NIL, the last value is returned.
or {form}* [special]
-
-
Forms are evaluated from left to right until non-NIL appears,
and the value is returned. If all forms are evaluated to NIL,
NIL is returned.
if test then [else] [special]
-
-
if can only have single then and else forms.
To allow multiple then or else forms,
they must be grouped by progn.
when test forms [macro]
-
-
Unlike if,
when and unless allow you to write multiple forms
which are executed when test holds (when) or
does not unless.
On the other hand, these macros
cannot have the else forms.
unless test forms [macro]
-
-
is equivalent to (when (not test) . forms).
cond (test {form}*)* [special]
-
-
Arbitrary number of cond-clauses can follow cond.
In each clause, the first form, that is test, is evaluated.
If it is non-nil, the rest of the forms in that clause are evaluated sequentially,
and the last value is returned.
If no forms are given after the test, the value of the test is returned.
When the test fails, next clause is tried until a test which is evaluated
to non-nil is found or all clauses are exhausted.
In the latter case, cond returns NIL.
case key {({label ({lab}*) {form}*)}* [macro]
-
-
For the clause whose label matches with key,
forms are evaluated and the last value is returned.
Equality between key and label is tested with eq
or memq, not with equal.
k-okada
2013-05-21