Version française
Home     About     Download     Resources     Contact us    
Browse thread
Representation of objects
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Nathaniel Gray <n8gray@g...>
Subject: Re: [Caml-list] Representation of objects
On 8/16/05, Jacques Garrigue <garrigue@math.nagoya-u.ac.jp> wrote:
> From: Nathaniel Gray <n8gray@gmail.com>
> 
> > I've got two questions:
> >
> > 1.  Does this mean that essentially all method invocations need to
> > search the method table?  The method table of a superclass is no
> > longer a prefix of that of a subclass.  There's a GETMETHOD(i,obj)
> > bytecode, but I'm struggling to figure out when you could use it.
> 
> From other posts, it seems that you have found caml_get_public_method.

I have, but my question is whether or not this search is necessary on
every method call everywhere.  It seems like it probably is, but
perhaps there's something I haven't considered.  I'm basically trying
to figure out how clever the compiler is.

> > 2.  What about hash collisions?  There's no collision resolution code
> > in the method lookup functions.
> 
> The type system prevents them. That is, if there is a potential
> collision between tag names, it will be detected at compile time.

Ok, I see.

Thanks,
-n8

-- 
>>>-- Nathaniel Gray -- Caltech Computer Science ------>
>>>-- Mojave Project -- http://mojave.cs.caltech.edu -->