in reply to Re^6: Perl can do it, take 1 (sentence generation)
in thread Perl can do it, take 1 (sentence generation)
Actually, one of the major disappointments I have with Perl6 is the continued distinction between subs and blocks. Personally, I think that blocks should be first class entities in their own right.
If you assigned a block to a variable, it would become a named subroutine.
my $sub = { ## do stuff }; my $result = $sub();
if, [while, for etc. would be methods called on the block:
{ #do stuff }.if( cond ); .if( cond ) { ## indirect object form ## do stuff } .while( cond ) { ## do stuff } .for $a -> ( 0 .. 10 ) { ##do stuff }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: Perl can do it, take 1 (sentence generation)
by fergal (Chaplain) on Jun 21, 2005 at 17:59 UTC |