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 }

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
The "good enough" maybe good enough for the now, and perfection maybe unobtainable, but that should not preclude us from striving for perfection, when time, circumstance or desire allow.

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
    Is that Rubyish? Funny, in Smalltalk I think it's the other way around. If is just a method you can call on a value and it takes blocks of code as paramter.