http://www.perlmonks.org?node_id=469495


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!