Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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 about the Monastery: (4)
As of 2024-05-30 02:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found