<?xml version="1.0" encoding="windows-1252"?>
<node id="253441" title="Re: Re: Prolegemona To A Future Scripting Language: Game Of Life In Perl 6" created="2003-04-26 22:16:18" updated="2005-07-03 08:52:19">
<type id="11">
note</type>
<author id="107600">
TheDamian</author>
<data>
<field name="doctext">
I should point out that the line:

&lt;code&gt;
      my $live = sum(@.grid[$^x-1..$^x+1][$^y-1..$^y+1]);
&lt;/code&gt;

is somewhat speculative. It's not clear to me how multidimensional slices will interact with flattening contexts (such as the argument list of the standard &lt;code&gt;&amp;sum&lt;/code&gt; function).

&lt;p&gt;It might be that that line needs to be:

&lt;code&gt;
      my $live = sum(map {sum .[$^y-1..$^y+1]} @.grid[$^x-1..$^x+1]);
&lt;/code&gt;

Though, given how ugly that is, I'd naturally prefer &lt;code&gt;sum&lt;/code&gt; to be smart enough to flatten multidimensional slices.</field>
<field name="root_node">
253366</field>
<field name="parent_node">
253438</field>
</data>
</node>
