merits of Lisp vs Python

Wade Humeniuk whumeniu+anti+spam at telus.net
Fri Dec 15 10:23:06 EST 2006


Paul Rubin wrote:

> 
> "nif" is even cleaner in Haskell, if I have this right:
> 
>     nif x p z n | (x < 0) = n
>                 | (x == 0) = z
>                 | (x > 0)  = p
> 
> All Haskell evaluation is automatically lazy, so no lambdas etc. needed.

You can use that style in CL.

(defun nif (x p z n)
   (or (when (< x 0) n)
       (when (= x 0) z)
       (when (> x 0) p)))


Wade



More information about the Python-list mailing list