Hi Tomas,

thinking about it, I probably wrote nonsense yesterday:

> If you have a function 'rankClass' which returns the depth where a class
> in the hierarchy is located
> 
>    (de rankClass (Cls)
> ...

The depth does not matter, right?

Instead, the top-level base classes must be compared (you used
'subclass?' respectively 'isa' after all). And, it looks like 'NIL's
must be greater than anything else.


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?

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe

Reply via email to