Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Prolegemona To A Future Scripting Language: Game Of Life In Perl 6

by jryan (Vicar)
on Apr 26, 2003 at 22:31 UTC ( #253416=note: print w/ replies, xml ) Need Help??


in reply to Prolegemona To A Future Scripting Language: Game Of Life In Perl 6

A few comments:

$newgrid[$x][$y] = given @.grid[$x][$y] { when 0 { 1 if $live == 3}; when 1 { 1 if 1 < $live < 4 }: } || 0;

Is probably better written as:

$newgrid[$x][$y] = given @.grid[$x][$y] { when 0 { 1 if $live == 3}; when 1 { 1 if 1 < $live < 4 }; default { 0 }; };

However, the exact semantics of the given statement haven't been fully defined yet (as in, if it returns the return value of the last given), so it might not be good to rely on that. Chances are, if it is implemented as a builtin multimethod, it will, though.

? ... : is now ?? ... :.

<STDIN> should be <$*STDIN>, since filehandles are now scalars, and STDIN is a global. (<> might still default to STDIN, though.)

Pretty good tho.

Also, there are 2 working versions of life in the Perl6 compiler located in parrot/languages/perl6. (As if anyone cared. :-/)


Comment on Re: Prolegemona To A Future Scripting Language: Game Of Life In Perl 6
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2014-11-26 13:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (171 votes), past polls