Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] How to throw away oop?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Didier Le Botlan <lebotlan@b...>
Subject: Re: [Caml-list] How to throw away oop?
May be this solution is not suitable to your problem, however I notice
that you do not use parameterized constructors (nor parameterized
classes). This is very common in ocaml, though.

You talk about Sequences. Fine. Sequences are lists (or whatever
structure you want).
A sequence of amino-acids is of type amino-acid list and a sequence of
dna-bases is of type dna list.
Any function that operates polymorphically on lists (that is, on any 'a
list) will operate as well on dna lists and amino-acids lists.
If you want to get the length of these sequences, you can use
List.length.

If you think that lists are not adequate for your problem, you are free
to write your own structure of type 'a sequence.
-------------------
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