[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: How +:symbol is parsed

Victor 'Zverok' Shepelev

8/22/2007 2:19:00 PM

From: Yukihiro Matsumoto [mailto:matz@ruby-lang.org]
Sent: Wednesday, August 22, 2007 4:59 PM
>
>In message "Re: How +:symbol is parsed"
> on Tue, 21 Aug 2007 01:39:00 +0900, "Victor \"Zverok\" Shepelev"
><vshepelev@imho.com.ua> writes:
>
>|I wanted to be evil and add my own custom semantics to +:some_symbol
>|constructs. But I've found such consctructs doesn't call Symbol#+@, while
>|+(:some_symbol) does call.
>
>For historical reason, + before literals works as "identity" (the
>function that returns the argument). This behavior will be fixed in
>the future, but not for 1.8.x, sorry.
>

OK. It wasn't "bug report" (as incorporating +:symbol semantics is mostly
evil, in any case), it was just "request for understanging".

V.