|
class === class often false?: msg#01156lang.ruby.general
Hi, I'm just noticing that some classes return true when testing themselves with #===, while others return false. For instance: (ruby 1.6.6 (2001-12-26) [i586-mswin32]) irb> Bignum === Bignum false irb> Bignum.id === Bignum.id true irb> Bignum == Bignum true irb> Bignum.ancestors [Bignum, Integer, Precision, Numeric, Comparable, Object, Kernel] irb> Kernel === Kernel true irb> Object === Object true irb> Comparable === Comparable false . . . It appears Comparable may be the culprit? Though, I've noticed Enumerable introduces the same kind of behavior. Just wondering if this behavior is intentional, and if so, why? Thanks, Bill
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Q) about singleton methods and access control, Patrick Bennett |
|---|---|
| Next by Date: | Re: class === class often false?, Hal E. Fulton |
| Previous by Thread: | Building tables dynamically with CGI class, Jason Underdown |
| Next by Thread: | Re: class === class often false?, Hal E. Fulton |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |