Hi Alex,

>> So a function that converts a list like
>>
>>    ((Cls1) (Cls2))
>>
>> to
>>
>>    (Top1 Top2)
>>
>> and
>>
>>    ((Cls1) NIL)
>>
>> to
>>
>>    (Top1 T)
>>
>> should do.
>
> I'll have to think about it.  Multiple inheritance complicates the
> whole thing so at first sight it seems too simple;-)

I don't think that would work.  It is not enough to order by the "top
class".  I think this problem is an example where a binary predicate
is better fit as it naturally expresses the programmers idea while a
unary weight would have to be computed somehow: assuming that a unary
weight always exists, I can imagine that it could be computed from the
binary predicate taking into account the size of the set being sorted;
however, computing it that way would be more complicated than passing
the binary predicate directly to the 'sort' function.

I still think it would be better if the 'sort' function had a second
optional argument to specify a binary predicate and the decision which
one to use should be "postponed" and left with an application
developer.  And the C code would not be that much more complicated or
inefficient for the existing approach/code.

Cheers,

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

Reply via email to