[squeak-dev] Properties of "<" in SortedCollection>>#sortBlock - reflexive, symmetric, transitive required?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Properties of "<" in SortedCollection>>#sortBlock - reflexive, symmetric, transitive required?

Milan Zimmermann-2
Hi,

Is the "<" opertaion in SortedCollection>>#sortBlock required to be reflexive,
symmetric and transitive ?

I have a set of classes with known parent class and try to sort them so they
install into the image in the right order (parent first). The obvious "<"
implementation of parent < child may not be enough because it not transitive
unless I do some more sophisticated manipulation (I only immediate descendant
relationship)..

The sortBlock documentation provides no help on this...

Thanks Milan

Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Properties of "<" in SortedCollection>>#sortBlock - reflexive, symmetric, transitive required?

Matthias Berth-2
Hi,


certainly you would not want all three of these, that would give an
equivalence relation :-)

I think that SortedCollection>>should: a precede: b is the crucial
method here, it uses <= as the default sorting relation. Another
interesting method for you might be sortTopologically.

Cheers

Matthias

On Sun, May 4, 2008 at 12:39 PM, Milan Zimmermann
<[hidden email]> wrote:

> Hi,
>
>  Is the "<" opertaion in SortedCollection>>#sortBlock required to be reflexive,
>  symmetric and transitive ?
>
>  I have a set of classes with known parent class and try to sort them so they
>  install into the image in the right order (parent first). The obvious "<"
>  implementation of parent < child may not be enough because it not transitive
>  unless I do some more sophisticated manipulation (I only immediate descendant
>  relationship)..
>
>  The sortBlock documentation provides no help on this...
>
>  Thanks Milan
>
>

Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Properties of "<" in SortedCollection>>#sortBlock - reflexive, anti-symmetric, transitive required?

Milan Zimmermann-2
On 2008 May 4, Matthias Berth wrote:
> Hi,
> certainly you would not want all three of these, that would give an
> equivalence relation :-)

Oops how embarassing, that is what I get for writing anything just after
waking up and before first coffee. I ment to ask whether the relation defined
by sortBlock must be all of (or only some of) "reflexive, anti-symmetric,
transitive", and/or whether any other condition is required for the sort to
work. I tried to Google for such things as related to Smalltalk but could not
find anything...

> I think that SortedCollection>>should: a precede: b is the crucial
> method here, it uses <= as the default sorting relation.
> Another
> interesting method for you might be sortTopologically.

thanks, i did not realize sortTopologically is on SortedCollection. So far I
ordered my class list manually (for installing classes into image) using an
algorithm that should achieve same as sortTopologically but more cumbersome.

Thanks Milan

>
> Cheers
>
> Matthias
>
> On Sun, May 4, 2008 at 12:39 PM, Milan Zimmermann
>
> <[hidden email]> wrote:
> > Hi,
> >
> >  Is the "<" opertaion in SortedCollection>>#sortBlock required to be
> > reflexive, symmetric and transitive ?
> >
> >  I have a set of classes with known parent class and try to sort them so
> > they install into the image in the right order (parent first). The
> > obvious "<" implementation of parent < child may not be enough because it
> > not transitive unless I do some more sophisticated manipulation (I only
> > immediate descendant relationship)..
> >
> >  The sortBlock documentation provides no help on this...
> >
> >  Thanks Milan