Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^7: Perl can do it, take 1 (sentence generation)

by BrowserUk (Patriarch)
on Jun 21, 2005 at 17:21 UTC ( [id://468760]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://468760]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2024-04-19 10:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found