in reply to Re: Functional Composition
in thread Functional Composition

I stand corrected, I chose '|' pretty arbitrarily to mimic unix pipes, and assumed that the left operand would always be evaluated first. I do know what "left associative" means though, there was an "and" in that sentance :-)

Bill H
perl -e 'print sub { "Hello @{[shift->()]}!\n" }->(sub{"World"})'

Replies are listed 'Best First'.
Re^3: Functional Composition
by ikegami (Patriarch) on Dec 17, 2009 at 21:22 UTC

    there was an "and" in that sentance

    There was a possibility that you meant "and therefore". If not, then you can ignore the top half while others benefit from it.

      No problem, It does provoke a random question though: If you overload a short-circuited operator, does it still short-circuit? I mean if the result of an intermediate operation returned a false value, would the whole expression end up false?

      Bill H
      perl -e 'print sub { "Hello @{[shift->()]}!\n" }->(sub{"World"})'
        Turns out you can't overload them. If there's an object on the LHS, it will have its "bool" overload called. An object on the RHS will simply be returned if the LHS is true.