[tpm] Riddle me this ...

Uri Guttman uri at stemsystems.com
Fri Dec 28 20:36:46 PST 2012


On 12/28/2012 11:28 PM, Fulko Hew wrote:
> On Fri, Dec 28, 2012 at 10:57 PM, James E Keenan <jkeen at verizon.net> wrote:
>
>> On 12/27/12 11:43 PM, Uri Guttman wrote:
>>
>>   i want to clarify my statement there. it is the scalar prototype of not
>>> that is causing this as well as its low precedence.
>>>
>>
>> I'm familiar with prototypes as an aspect of subroutines in Perl (for
>> instance, Test::More::is is, under the hood, prototyped $$;$), but not with
>> the concept of prototypes for operators.  Can you point me toward the
>> documentation or source code for that?
>>
>
>
> Don't think about prototypes, its seems you are encountering a precedence
> issue.

it is a combination of the prototype and precedence as i showed. without 
the $ prototype of 'not', it wouldn't force the , to be in scalar mode 
and have it return the test name as the arg to not. that is why the name 
wasn't ever printed in all of jim's cases.

the precedence comes into play as it allows the , to be evaluated first 
before 'not'. ! would bind tightly to the first value and let , be a 
list op (context provided by the ok() call).

this only happens because both the low precedence of 'not' and its 
scalar prototype work to make , into a scalar op with 2 args.

uri




More information about the toronto-pm mailing list