<?xml version="1.0" encoding="windows-1252"?>
<node id="767734" title="Re: TIMTOWTDI, synergy" created="2009-06-02 15:02:52" updated="2009-06-02 15:02:52">
<type id="11">
note</type>
<author id="80322">
John M. Dlugosz</author>
<data>
<field name="doctext">
Let me continue by pointing out that in Perl 6 you would not write &lt;code&gt;max&lt;/code&gt; as a list operator or function.  Rather, write it as an infix (2-argument) function, and the system will automatically generate the matching reduction operator.  Or, write the reduction operator yourself if that's more efficient, but use the reduction syntax:

&lt;code&gt;
sub infix:&lt;max&gt; (::Type $left, Type $right --&gt; Type)
 {
   return $left after $right ?? $left !! $right;
 }

sub prefix:&lt;[max]&gt; (::Type *$first, Type *@rest --&gt; Type) { ... }
&lt;/code&gt;

That leaves off the details of how to make it a chaining operator (I guess max chains through normal association) and declaring its level of precedence and associativity, etc.</field>
<field name="root_node">
492651</field>
<field name="parent_node">
767727</field>
</data>
</node>
