[racket-dev] And/or as procedures when not in application position

From: Sam Tobin-Hochstadt (samth at ccs.neu.edu)
Date: Mon Dec 10 20:53:55 EST 2012

On Mon, Dec 10, 2012 at 7:07 PM, Matthias Felleisen
<matthias at ccs.neu.edu> wrote:
>
> Using and and or as higher-order functions, say for (fold (combine f and) #t l) has performance implications. It is quite different from (andmap f l).

In one sense, this is obviously true, since `andmap` is
short-circuiting.  But with a sightly different implementation of
`andmap`, I think (based on looking at the decompiled output) that
these would generate basically identical code.  So the extra
higher-orderness shouldn't be a performance problem here.

Sam

Posted on the dev mailing list.