Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

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

by wolv (Monk)
on Jun 23, 2005 at 20:02 UTC ( #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?

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2020-05-31 10:38 GMT
Find Nodes?
    Voting Booth?
    If programming languages were movie genres, Perl would be:

    Results (173 votes). Check out past polls.