Wade Humeniuk <[EMAIL PROTECTED]> writes: > > "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)))
Yeah but you can't apply it the same way. [nif x p z n | x <- [0,2.5,-8]] evaluates exactly one of p, z, or n, for each of the args in that list. Side effects don't work the same way either, you have to use special declarations around code with side effects. I'm not yet conversant enough with Haskell to know how to do it for this example though. -- http://mail.python.org/mailman/listinfo/python-list