Browse thread
module Set
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ 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 <Xavier.Leroy@inria.fr> 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
> set.ml 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
OrderedSet.
Stefan
----
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.
Stefan