the use of #pointsTo: (Re: Boolean expressions (was: Re:
[squeak-dev] Re: Object>>#is:? (was: Re: PackageDependencyTest)))
siguctua at gmail.com
Thu Mar 4 22:14:38 UTC 2010
On 4 March 2010 23:47, Michael Haupt <mhaupt at gmail.com> wrote:
> Hi Igor,
> On Thu, Mar 4, 2010 at 10:43 PM, Igor Stasenko <siguctua at gmail.com> wrote:
>> Btw, i find it surprising that:
>> Array new pointsTo: Array
>> answering false.
>> An instance of class is always points to its class, no?
> doesn't #pointsTo: only take indexable / named fields into account?
> The class is encoded in the header, that might well be out of scope.
> Also, Array is a special class (fast lookup from 1-word header),
> right? So the pointer is even less easy to extract. :-P
> I need to go to sleep now. :-)
Well, but when you walking the object graph (and #pointsTo: is
existing exactly for doing that), you need to know all connections
This is where #pointsTo: lies to us, because obviously, all instances
pointing to their corresponding classes.
Concerning subtleties, like special header format and things like
that: hey, this is a primitive after all, and it quite easy to
get a class object from its instance. Otherwise , how then a message
sending machinery might work without being able to do that? :)
Igor Stasenko AKA sig.
More information about the Squeak-dev