View · Search · Index
No registered users in community xowiki
in last 10 minutes

Re: [Xotcl] info method behaviour

From: Kristoffer Lawson <setok_at_fishpool.com>
Date: Sun, 12 Aug 2001 19:26:54 +0300 (EEST)

On Sun, 12 Aug 2001, Zoran Vasiljevic wrote:

>
> without extra knowledge about what are
> "foo" and "bar" actually.
> The "foo" may be an instproc whereas
> the "bar" may be a per-instance proc
> or vice versa. Correct?

Yes, exactly. I also believe that kind of introspection is quite
natural for an object syste. While inheritance is naturally useful,
I still like to think of objects as independent entities. Thus to do
the above feels useful.

> I would, for example, override the "info"
> method with some custom code which tries
> the per-instance proc first and if it does
> not find any, goes to the instproc.
> This should't be difficult to implement.

It is possible to do (I think), but I'm wondering if this is an oversight
in the info functionality provided by XOTcl? It is a bit messy to first
test for if a procedure exists in the object, and then search the class,
and then any possible mixin class. The same must be done again for getting
a list of available methods. And then up to the superclasses.

         - ---------- = = ---------//--+
         | / Kristoffer Lawson | www.fishpool.fi|.com
         +-> | setok_at_fishpool.com | - - --+------
             |-- Fishpool Creations Ltd - / |
             +-------- = - - - = --------- /~setok/