in reply to Re^3: (almost) foldl
in thread (almost) foldl
Whilst Aristotle's Y() combinator is very clever, the requirement to assign the coderef to a local variable complicates the using code.
If something along these lines were to be built-in, I'd like to simplify it so that you could write:
print sub{ ( shift() // return ) + &$^SUB }->( 1 .. 10 );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: (almost) foldl
by dk (Chaplain) on Jun 10, 2011 at 07:41 UTC | |
by TimToady (Parson) on Jun 10, 2011 at 23:29 UTC | |
by BrowserUk (Patriarch) on Jun 10, 2011 at 08:04 UTC |