V
Vladimir Fekete
Hi *,
could you help me please ? I'm trying to write a code where I could have
operators' functions as values of hash and executing them in way like this
(formal code):
#=============================
operators = { "+" => Fixnum.+,
"-" => Fixnum.-,
"++" => Myclass.++}
op = "+"
result = operators[op](left,right) if left.class==Fixnum and right.class==Fixnum
#============================
is it possible ? Thanks,
Cheers,
V.
could you help me please ? I'm trying to write a code where I could have
operators' functions as values of hash and executing them in way like this
(formal code):
#=============================
operators = { "+" => Fixnum.+,
"-" => Fixnum.-,
"++" => Myclass.++}
op = "+"
result = operators[op](left,right) if left.class==Fixnum and right.class==Fixnum
#============================
is it possible ? Thanks,
Cheers,
V.