Filip Konvička wrote:
I think that there must be lots of reusable code out there. Maybe people are just too modest to contribute...?

What can we say?  Don't be modest! :-)

BTW, one problem with such a stdlib is to define a style for the data structures. The main styles are: functional (stateless), imperative (like Dictionary), and object-oriented. Moreover, it would be nice if the provided stateful data structures are thread-safe.

I am a bit surprised by the way you use object features, because you use them as class features. (Some people even consider those features as a design mistake.) Why don't you use standard methods?

This way I expose similar interface as the Dictionary module, and the syntax is exactly the same (well, except the syntactic sugar available for dictionaries). I guess that I should provide a module rather than a class.

We could provide a module with several classes like yours, but the usual way is to provide a module that exports procedures and classes. Note that the implementation can be object-based, and procedures simply call the object:

class RBTreeClass
   attr root
   meth put(Key Value) ... end
   ...
end

proc {Put T Key Value} {T put(Key Value)} end

Joachim Niehren wrote a MOGUL package with a double style like this (mogul:/niehren/base).


Cheers,
raph

_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to