Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

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

by wolv (Pilgrim)
on Jun 23, 2005 at 20:02 UTC ( [id://469495]=note: print w/replies, xml ) Need Help??


in reply to Re: Perl can do it, take 1 (sentence generation)
in thread Perl can do it, take 1 (sentence generation)

Here is my version of the generate sub. Won't probably run on Pugs right now.
use v6; sub generate { when List { .map:{ generate $_ } } when %dict { generate %dict{$_}.pick } default { [ $phrase ] } }
For some reason I'm assuming that $_ is aliased to the first argument of a sub when there is no signature specified. If that's wrong, please tell me!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-20 04:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found