Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
module Set
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Stefan Monnier <monnier+lists/caml/news/@T...>
Subject: Re: module Set
Xavier Leroy <> writes:
> I'd rather not.  What you're looking for is not sets, but sets with
> some extra ordering properties.  Don't use the generic Set package, then.
> Use your own Ordered_set package.  (Feel free to cut and paste from
> to implement it, of course.)  Well-defined abstract interfaces
> are more important that code sharing, in my opinion.

Of course, you can have your cake and eat it too in the present case:
rename the current Set into OrderedSet (for instance) and then create
a Set module (now that the other one disappeared) as a wrapper around



Donc, en gros, au lieu de définir Set et OrderedSet indépendemment,, il suffit
de définir Set au-dessus de OrderedSet et comme ça on peut avoir le beurre et
l'argent du beurre: une interface propre et une bonne réutilisation du code.