if I try someObject.instance_eval(“class”) I get :
in instance_eval': (eval):1:ininstance_eval’: compile error
(SyntaxError)
(eval):1: syntax error
class
I am using PragProgs install for 1.8 for Windows. Is this expected
or a bug?
As a work around I am using send() instead, but I believe I had
tested them in the past and found instance_eval to be faster than
send.
Walt
P.S. Note I am not really doing the above, I am taking a string using
it dynamically, it just happened to crash with “class”
···
Walter Szewelanczyk
IS Director
M.W. Sewall & CO. email : walter@mwsewall.com
259 Front St. Phone : (207) 442-7994 x 128
Bath, ME 04530 Fax : (207) 443-6284
if I try someObject.instance_eval(“class”) I get :
in instance_eval': (eval):1:in instance_eval’: compile error
(SyntaxError)
(eval):1: syntax error
class
I am using PragProgs install for 1.8 for Windows. Is this expected
or a bug?
I guess it’s expected, you’d have to do self.class to make it work:
class
SyntaxError: compile error
(irb):1: syntax error
from (irb):1
type
(irb):3: warning: Object#type is deprecated; use Object#class
=> Object
“a”.instance_eval{self.class}
=> String