J
Jun Young Kim
Hi, all
I try to use comparision operator as a symbol type.
but, I met the following problems.
Here is my example.
irb(main):001:0> a = 1
=> 1
irb(main):002:0> a.send==, 1)
=> true
irb(main):003:0> a.send==, 2)
=> false
irb(main):004:0> a.send>, 0)
=> true
irb(main):005:0> a.send>, 2)
=> false
irb(main):006:0> a.send!=, 2)
SyntaxError: compile error
(irb):6: syntax error, unexpected tNEQ, expecting tSTRING_CONTENT or
tSTRING_DBEG or tSTRING_DVAR or tSTRING_END
a.send!=, 2)
^
from (irb):6
from :0
irb(main):007:0> a.send('==', 2)
=> false
irb(main):008:0> a.send('!=', 2)
NoMethodError: undefined method `!=' for 1:Fixnum
from (irb):8:in `send'
from (irb):8
from :0
irb(main):009:0>
Is any idea?
I try to use comparision operator as a symbol type.
but, I met the following problems.
Here is my example.
irb(main):001:0> a = 1
=> 1
irb(main):002:0> a.send==, 1)
=> true
irb(main):003:0> a.send==, 2)
=> false
irb(main):004:0> a.send>, 0)
=> true
irb(main):005:0> a.send>, 2)
=> false
irb(main):006:0> a.send!=, 2)
SyntaxError: compile error
(irb):6: syntax error, unexpected tNEQ, expecting tSTRING_CONTENT or
tSTRING_DBEG or tSTRING_DVAR or tSTRING_END
a.send!=, 2)
^
from (irb):6
from :0
irb(main):007:0> a.send('==', 2)
=> false
irb(main):008:0> a.send('!=', 2)
NoMethodError: undefined method `!=' for 1:Fixnum
from (irb):8:in `send'
from (irb):8
from :0
irb(main):009:0>
Is any idea?