Classes *don't* inherit from nil. nil is at the end
of their superclass chain. That's different from inheriting.
At least in current images UndefinedObject includesBehavior:
nil is false, which seems right to me. nil is not a behavior;
its use as the sentinel at the end of the superclass chain
doesn't imply it is a behavior. So I propose that we
change includesBehavior:ThatOf: to something like
StackInterpreter methods for plugin primitive support
includesBehavior: aClass ThatOf: aSuperclass
"Return
the equivalent of
aClass
includesBehavior: aSuperclass.
Note:
written for efficiency and better inlining (only 1 temp)"
|
theClass |
<inline:
true>
aSuperclass
= objectMemory nilObject ifTrue:
[^false].
theClass
:= aClass.
[theClass
= aSuperclass ifTrue:
[^true].
theClass ~= objectMemory nilObject] whileTrue:
[theClass
:= self superclassOf: theClass].
^false
I don't think this will affect anything other than FFI and
Alien since those are the only uses I can find, and in my
reading of that code the proposed change seems fine; safer in
fact.
Agreed?