Hi, all, do you guys know how to do "and" and "or" in lisp?
Posted: Sun Nov 03, 2013 9:27 am
I mean in the "if" and "cond". How to evaluate multiple conditions? Thx.
Discuss and learn Lisp programming of all dialects. NOTICE: Site locked. No new users or posts.
http://lispforum.com/
Code: Select all
(macroexpand
'(cond ((test-predicate-function arg) (consequent1-with-sideeffect)
(consequent2-tail-call))
(test-predicate-value consequent-value1)
(t (alternative-expression))))
; ==>
(if (test-predicate-function arg)
(progn (consequent1-with-sideeffect)
(consequent2-tail-call))
(if test-predicate-value
consequent-value1
(alternative-expression)))