[OT] Pepsi how to read _vtable>>_delegated code

Mathieu mathk.sue at gmail.com
Fri Nov 17 22:36:38 UTC 2006

Ian Piumarta a écrit :
> Hi Math,
>> So I want to read of pespsi code and in particular the #_delegated
> method of the _vtable object.
> It's a primitive so (assuming you have the pepsi tarball) look in
> lib/libid.c for the function _vtable__delegated().
> (This method doesn't have to be a primitive, but I've been too lazy to
> finish writing the reflection example to include it as a non-primitive. 
> Look in examples/reflect for lots of other primitives that are
> reimplemented at the user level;  _delegated should be among these, and
> one day I will get round to it.)

Yes that exactly what I search for thanks.
So I have still some remain questions :)

What the #_vtable message return(I have some idea but it's a bit fuzzy)?

reading C generated from source I see a lote of:
struct t_Object {
  struct _vtable *_vtable[0];

But it's never use why?

Can you explain me this(Only if you have time and motivation)?:
union t__object
  oop		_vtable[0];
  _closure_t	 closure;
  _selector_t	 selector;
  _assoc_t	 assoc;
  _vector_t	 vector;
  _vtable_t	 vtable;

Union it's quite pretty but hard to understand especialy when you don't know type used inside

Anyway what is the semantic of t_ or _t?

Thanks for any of answer that you can give me


> Hope that helps.

Of course :)

> Cheers,
> Ian

More information about the Squeak-dev mailing list