I suspect that you see a side effect of the parser's behavior in how it interprets numeric literals.
If we create our own class:
class C
def +@
11
end
end
and then look at some things:
> c = C.new
> +c
=> 11
> ++c
=> 11
That is what we expect. If we use the override of Fixnumunary +and a Fixnum:
> n = 23
> +n
=> 15
> ++n
=> 15
, . +@ .
+6 :
> +6
=> 6
+@ . , -@:
class Fixnum
def -@
'pancakes'
end
end
, :
> -42
=> 42
, ? , Ruby +6 -42 6.send(:+@) 42.send(:-@), .
, +(6) -(42), Ruby . , .