caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Objects or modules ?
@ 2002-06-29  1:14 Nicolas FRANCOIS
  2002-06-29  6:47 ` Chris Hecker
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Nicolas FRANCOIS @ 2002-06-29  1:14 UTC (permalink / raw)
  To: Caml List

I'd like to make a library managing mathematical data structures, for
example integers, polynoms, fractions, and more if anyone is interested. I
started on the module point of view, mainly to learn how to use modules
and functors. So this is the structure I have :

Ordered_Ring : module managing basic rings operations
Rationnals : Num rationnals adapted to Ordered_Ring
Polynoms : functor taking an ordered ring S in argument to make a module
managing S[x]
Q_polynoms : polynoms over rationnals.

But I see things differently now, mainly because I realized S[x] is an
euclidian ring just as S is, so they should inherit the same module, and
have common operations ((extended) Euclide, square_free factorization...).
in fact I realized this when I started writing my second gcd function.

So my point of view is now :

Euclidian_Ring : Functor taking a ring signature (data structure, basic
operation + and *, link with Z and Q...), and constructing an euclidian
ring with tools.
Rationnals : Euclidian_Ring(Sig_Num)
Sig_Pol : Functor constructing an abstract polynom module sig
Polynom : functor constructing a ring S[x] provided a ring S

Do you think this plan is correct ? Should I translate it to objects ? Is
there some drawbacks using modules or objects ?

Thanks for reading.

\bye

-- 

                   Nicolas FRANCOIS
            http://nicolas.francois.free.fr
 A TRUE Klingon programmer does NOT comment his code
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2002-07-04 23:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-29  1:14 [Caml-list] Objects or modules ? Nicolas FRANCOIS
2002-06-29  6:47 ` Chris Hecker
2002-06-30  6:44   ` Blair Zajac
2002-06-29 10:22 ` Markus Mottl
2002-07-03 23:16   ` Nicolas FRANCOIS
2002-07-05  0:02     ` Nicolas FRANCOIS
2002-07-01  1:19 ` Nicolas FRANCOIS
2002-07-02 17:24 ` Francois Pottier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).