In reply to Buddha Buck <[EMAIL PROTECTED]>:

> At 08:58 AM 04-23-2002 -0700, Larry Wall wrote:
> >Precedence is set with the "like' property:
> >
> >     my sub operator:now ($a,$b) is like("but") is inline { $a but $b
> }
> >     sub operator:also ($a,$b) is like("and") is inline { $a and $b }
> 
> OK, but that limits you to the, um, 24 standard levels of precedence. 
> What 
> do you do if you don't think that that's enough.  Let's say you want to
> 
> define a "nand" operator:
> 
> my sub operator:nand ($a, $b) is inline { not ($a and $b) }
> 
> but you want nand to have a precedence lower than the existing 'and' but
> 
> higher than the existing 'or' (for some reason I can't imagine 
> offhand).  It isn't like() anything, since there isn't anything
> currently 
> between 'and' and 'or'.  Would that be something like:
> 
> my sub operator:nand ($a, $b) is below("and") is inline {not ($a and $b)
> }
> 

24 levels of precedence should be enough, else you can always resort to parens.

Guillaume

Reply via email to