instance_eval("class") error/bug???

W

walter

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?

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 : (e-mail address removed)
259 Front St. Phone : (207) 442-7994 x 128
Bath, ME 04530 Fax : (207) 443-6284
*****************************************************
 
M

Mauricio Fernández

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:
SyntaxError: compile error
(irb):1: syntax error
from (irb):1(irb):3: warning: Object#type is deprecated; use Object#class
=> Object=> String

--
_ _
| |__ __ _| |_ ___ _ __ ___ __ _ _ __
| '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \
| |_) | (_| | |_\__ \ | | | | | (_| | | | |
|_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_|
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

win-nt from the people who invented edlin.
-- MaDsen Wikholm, (e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top