Hi Casey,There is also this list, for beginners specifically:
Casey Basichis wrote:
Hi,
I'm new to Ocaml.
http://groups.yahoo.com/neo/groups/ocaml_beginners/infoDo you mean that the lists are fixed-length, that you have a record type something like
I have five lists of ints, how can I can I combine them into a list of
records where the fields are filled with values from each of the lists?
type t = {a : int; b : int; c : int; d : int}
and you want to convert each list, which is something like
[1; 2; 3; 4]
into a record something like
{a = 1; b = 2; c = 3; d = 4}
?
In which case, you want to use pattern matching to write a function of type
int list -> t
which converts a (fixed-length) list to a thing of type t and then you can use List.map to deal with all your lists, producing a t list from an int list list.
If you meant something different entirely, please clarify!
With Thanks,
--
John Whitington
Director, Coherent Graphics Ltd
http://www.coherentpdf.com/