From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id IAA22035; Fri, 24 Oct 2003 08:32:48 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id IAA11371 for ; Fri, 24 Oct 2003 08:32:47 +0200 (MET DST) Received: from mail.davidb.org (adsl-64-172-240-129.dsl.sndg02.pacbell.net [64.172.240.129]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h9O6Wj129334 for ; Fri, 24 Oct 2003 08:32:46 +0200 (MET DST) Received: from davidb by mail.davidb.org with local (Exim 3.36 #1 (Debian)) id 1ACowZ-0001Aw-00; Thu, 23 Oct 2003 16:32:39 -0700 Date: Thu, 23 Oct 2003 16:32:39 -0700 From: David Brown To: Dustin Sallings Cc: caml-list@inria.fr Subject: Re: [Caml-list] newbie type problem Message-ID: <20031023233239.GA4477@davidb.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 caml-list:01 newbie:01 hashtable:01 hashtable:01 hashtbl:01 arrays:01 ocaml:01 0700,:01 int:01 int:01 refs:02 refs:02 objects:02 string:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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