False instance and false class and set_trace_func

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.

Hi --

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

···

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

--
David A. Black
dblack@wobblini.net