by shigemk2

当面は技術的なことしか書かない

対話によるCommon Lisp入門 47 and

andは、制御構造のひとつで、
引数の評価結果が全て真なら真を返す。

これは、左から評価していってるので、
1つ目が偽なら、あとのフォームは評価しない。

[2]> (setf x 5)
5
[3]> (and (> x 0) (integerp x))
T
[4]> (setf x 'one)
ONE
[5]> (and (> x 0) (integerp x))

*** - >: ONE is not a real number
The following restarts are available:
USE-VALUE      :R1      Input a value to be used instead.
ABORT          :R2      Abort main loop
Break 1 [6]> :a
[7]> (and (integerp x) (> x 0))
NIL