V
Victor \Zverok\ Shepelev
Hi.
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.
I can suppose it's reason of numbers construction in parser
+3 #doesn't calls Fixnum#+@, it's like Finxum.new(+3),
+(3) #does calls Fixnum#+@, it's like Fixnum.new(3).+@
but it's still strange for me this rule works for symbols too (but not for
strings, +"test" calls String#+@). Can somebody please explain this
strangeness?
Thanks.
V.
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
+
I can suppose it's reason of numbers construction in parser
+3 #doesn't calls Fixnum#+@, it's like Finxum.new(+3),
+(3) #does calls Fixnum#+@, it's like Fixnum.new(3).+@
but it's still strange for me this rule works for symbols too (but not for
strings, +"test" calls String#+@). Can somebody please explain this
strangeness?
Thanks.
V.