On Tue, 13 Mar 2007, John Cowan wrote:
AndrevanTonder scripsit:
I do not personally like one-armed IF, but let me point out that AND/OR
can also be used instead of WHEN/UNLESS.
"when" and "unless", however, nicely discard all values except the value
of the guard, which is not true of "and" or "or". (when p a b) evaluates
b iff it evaluates a, regardless of the value of a; not so for (or p a b).
Well, I would write
(and p (begin a b))
which is a little longer. However, the following common case is shorter with
AND
(and p1 p2 p3 a)
(when (and p1 p2 p3) a)
Also, in the following cases OR is shorter
(or p a)
(unless p a)
(or p1 p2 p3 a)
(unless (or p1 p2 p3) a)
Andre
_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss