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 );
In reply to Re^4: (almost) foldl
by BrowserUk
in thread (almost) foldl
by dk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |