in reply to Re^11: Specializing Functions with Currying
in thread Specializing Functions with Currying

first is pure-Perl and does not have short-circuiting behaviour.

And if you look at the the source just before the pure perl reduce definition we find:

eval <<'ESQ' unless defined &reduce; # This code is only compiled if the XS did not load

:-)

So the reduce() in question may, or may not, be pure perl.

Replies are listed 'Best First'.
Re^13: Specializing Functions with Currying
by Aristotle (Chancellor) on Aug 09, 2004 at 14:34 UTC

    Oops.

    Interesting, also, that the XS version does short-circuit. I looked at the source and thought I could see that, but I don't know XS so to be sure, I tested. And lo:

    $ perl -MList::Util=first -le'@_=(0)x100; first { ++$a; $_ == 0 } @_; +print $a' 1

    Hmm.

    Makeshifts last the longest.