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

Re: IF



A suggestion: change the definition of IF so that
     (IF TEST THEN ELSE ELSE ELSE)
becomes
     (COND (TEST THEN) (T ELSE ELSE ELSE))
E.g.,
     (DEFMACRO IF (TEST THEN . ELSES)
        `(COND (,TEST ,THEN)
               (T ,@ELSES)))
Note that this is compatible with the present definition of IF.

Another nice thing to have is IFNOT:
     (DEFMACRO IFNOT (TEST . ELSES)
        `(COND (,TEST) (T ,@ELSES))
that is, return this if it is non-NIL, otherwise do that stuff.

     - Phil Agre

(I do the former myself but the "User is illegally redefining ... " queries
are pain.)