Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] newbie type problem
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: David Brown <caml-list@d...>
Subject: Re: [Caml-list] newbie type problem
On Thu, Oct 23, 2003 at 11:11:29PM -0700, Dustin Sallings wrote:

> type per_block = {
>     pb_ts: int;
>     pb_counts: [hashtable goes here];
>     pb_times: [hashtable goes here];
> };;
> 
> 	Can anybody tell me what I'm actually trying to do here?

It is a little hard, since I can't tell what you're trying to represent.
Also, a hashtable might not be the best data structure.

What information are you trying to keep track of?  A hashtable maps
objects of one type to another.  If you wanted the pb_counts field to
map strings to int refs (so you can change the refs), you could use a

   pb_counts: (string, int ref) Hashtbl.t

without more information, it is hard to tell if that is what you really
want.

Ocaml also has arrays, maps, sets, and there are numerous libraries with
other structures as well.

Dave Brown

-------------------
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