Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > false instance and false class and set_trace_func

Reply
Thread Tools

false instance and false class and set_trace_func

 
 
trans. (T. Onoma)
Guest
Posts: n/a
 
      09-25-2004
When I use set_trace_func the class argument that is passed in is often just
'false', which I just took to be the FalseClass, having always thought they
were synonymous. I see now that is not so:

false.class
=> FalseClass
irb(main):002:0> false.class.name
=> "FalseClass"
irb(main):003:0> false.name
NoMethodError: undefined method `name' for false:FalseClass
from (irb):3

So then why is set_trace_func turning up with false in the class parameter?

Thanks,
T.


 
Reply With Quote
 
 
 
 
David A. Black
Guest
Posts: n/a
 
      09-25-2004
Hi --

On Sun, 26 Sep 2004, trans. (T. Onoma) wrote:

> When I use set_trace_func the class argument that is passed in is often just
> 'false', which I just took to be the FalseClass, having always thought they
> were synonymous. I see now that is not so:


false is an instance of FalseClass.

> false.class
> => FalseClass
> irb(main):002:0> false.class.name
> => "FalseClass"
> irb(main):003:0> false.name
> NoMethodError: undefined method `name' for false:FalseClass
> from (irb):3
>
> So then why is set_trace_func turning up with false in the class parameter?


I think it does that for 'line' events.


David

--
David A. Black
http://www.velocityreviews.com/forums/(E-Mail Removed)



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
set_trace_func and exceptions Joel VanderWerf Ruby 2 07-10-2007 05:02 PM
False positive, false intrusion, false alarm Nick Computer Security 3 04-26-2006 07:40 PM
How to get parameter names when in set_trace_func callback? Stephen Kellett Ruby 2 12-12-2004 09:15 AM
How to implement set_trace_func callback in C/C++? Stephen Kellett Ruby 5 11-30-2004 07:51 PM
false instance and false class and set_trace_func trans. (T. Onoma) Ruby 0 09-25-2004 05:34 PM



Advertisments