Hi Alex,

> BTW, this is almost the same as what 'isa' does. So it looks like that
> instead of
>
>    (subclass? LH RH)
>
> you could simply write
>
>    (isa RH LH)

Thanks, I'll have a look into it:-)

> The depth does not matter, right?

Yes, it is not the way to go.  It is something related to
"topological" sort, ordering elements of a "tree".

> And, it looks like 'NIL's must be greater than anything else.

Yes, NIL here is like T type in Common Lisp, a "super-class of all
classes".

> So a function that converts a list like
>
>    ((Cls1) (Cls2))
>
> to
>
>    (Top1 Top2)
>
> and
>
>    ((Cls1) NIL)
>
> to
>
>    (Top1 T)
>
> should do.
>
> This could be done simply with
>
>    (by
>       '((Lst)
>          (mapcar
>             '((L)
>                (or
>                   (not L)                       # Make 'T' from 'NIL'
>                   (prog                         # Else top level class
>                      (while (type (last L))
>                         (setq L @) )
>                      (last L) ) ) )
>             (car Lst) )
>       sort
>       Table )
>
> This assumes that 'Table' is of the form
>
>    (
>       (((+Asteroid) (+Asteroid)) (X Y) (prinl "aa"))
>       ...
>    )
>
> so that '(car Lst)' is '((+Asteroid) (+Asteroid))'.
>
>
> What do you think?

I'll have to think about it.  Multiple inheritance complicates the
whole thing so at first sight it seems too simple;-)

Thank you,

Tomas
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe

Reply via email to