Chaim Frenkel wrote:
> >>>>> "NI" == Nick Ing-Simmons <[EMAIL PROTECTED]> writes:
> NI> The "mg.c" 'magic hacks' are in essence applying vtable semantics (they
> NI> are even called vtables in the sources) to a subset of "values".
> NI> So yes vtables mean evrything is "magic" so nothing needs "special magic"...
> 
> Some 'official' method of passing on calls will be needed. So that it is
> easier to write magic.

I think types will be cheap. Doing magic might be something like:

  add fetch magic to value:
    new_type = copy_type(value->type)
    new_type->fetch = my_magical_fetch
    value->type = new_type

Of course, one of the standard types could be a "magic" type that checks
for per-value magic methods before dispatching to the value's normal type
table. I don't see that being necessary, but it's nice to know it's
possible.

- Ken

Reply via email to