[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

questions about IF



I just noticed something strange about the Symbolic's IF:
(I am still using 7.1 so this may not apply in 7.2?)

>(defun testif (x)
>  (if x (print 'a) (print 'b) (print 'c) (print 'd)) )
TESTIF
>(testif t)
A
A
>(testif nil)
B
C
D
D
>

So the else-clause to an IF is an implicit PROGN.
This is NOT in the Common-Lisp language specification?
Personally I believe it is an error since the code looks so funny :^)

     Someone said recently in this group that IF is now a more primitive than
the COND. Can I get more details on this? How could they have done this? Does
my code run faster now if I use Ifs than if I use Conds?

Bill <bouma@purdue.edu>