develooper Front page | perl.perl6.language | Postings from September 2005

Re: Operator sub names are not special

Thread Previous | Thread Next
From:
Yuval Kogman
Date:
September 1, 2005 01:32
Subject:
Re: Operator sub names are not special
Message ID:
20050901083206.GA4403@woobling.org
On Wed, Aug 31, 2005 at 13:43:57 -0600, Luke Palmer wrote:
> Uh yeah, I think that's what I was saying.  To clarify:
> 
>     sub foo (&prefix:<+>) { 1 == 2 }    # 1 and 2 in numeric context
>     foo(&say);   # nothing printed
> 
> But:
> 
>     sub foo (&prefix:<+>) { +1 == +2 }
>     foo(&say);    # "1" and "2" printed
> 
> Luke

Furthermore, even if:

	sub &infix:<==> ($x, $y) { +$x == +$y }
	sub foo (&prefix:<+>) { 1 == 2 }

	foo(&say); # nothing printed

but if 
	
	sub foo (&*prefix:<+>) { 1 == 2 }

then what?

-- 
 ()  Yuval Kogman <nothingmuch@woobling.org> 0xEBD27418  perl hacker &
 /\  kung foo master: /me does a karate-chop-flip: neeyah!!!!!!!!!!!!!!


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About