in reply to Re: recursive anonymous subroutines
in thread recursive anonymous subroutines
The J language has something like that, a magical operator called $: which always refers to the innermost verb it is used at.
However, I don't like that, and don't think it would be a good idea for perl. I'd rather like something like (one form of) the let macro in scheme. The equivalent to this would be something like this in perl: the hypothetical let NAME { BODY } ARGS could be equivalent to do { my sub NAME { BODY }; NAME(ARGS); }, where you can call NAME in the BODY too. Except we'd need a different name instead of let.
Update: redo wouldn't help. That only works if you have tail recursion. Redo doesn't return.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: recursive anonymous subroutines
by Daryn (Sexton) on Apr 06, 2006 at 21:08 UTC | |
by Anonymous Monk on Apr 08, 2006 at 21:55 UTC |
In Section
Seekers of Perl Wisdom