It seems that the inheritsFrom: method in GNU Smalltalk returns true for every undefined class name sent to it as a parameter. This might make a program very hard to debug, IMHO. Looking at the code for this in the Behavior class, it looks like this:
inheritsFrom: aClass [
"Returns true if aClass is a superclass of the receiver"
<category: 'testing the class hierarchy'>
| sc |
aClass isNil ifTrue: [^true].
sc := self.
[sc := sc superclass.
sc isNil] whileFalse: [sc == aClass ifTrue: [^true]].
^false
]
The line aClass isNil ifTrue: [^true] is the culprit, but I am looking for a sane reason as to way it was coded this way. (I am new to the Smalltalk world, by the way, and trying to learn.)
Thanks.