caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: David Brown <caml-list@davidb.org>
To: Dustin Sallings <dustin@spy.net>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] newbie type problem
Date: Thu, 23 Oct 2003 16:32:39 -0700	[thread overview]
Message-ID: <20031023233239.GA4477@davidb.org> (raw)
In-Reply-To: <E8022A28-05E8-11D8-B1A2-000393DC8AE4@spy.net>

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


  reply	other threads:[~2003-10-24  6:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-24  6:11 Dustin Sallings
2003-10-23 23:32 ` David Brown [this message]
2003-10-24  6:54   ` Dustin Sallings
2003-10-24  0:52     ` David Brown
2003-10-24  8:21       ` Dustin Sallings
2003-10-24 12:49         ` Andrew Lenharth
2003-10-24 13:22           ` Remi Vanicat
2003-10-29  7:23         ` Florian Hars
2003-10-29  8:03           ` Dustin Sallings
2003-10-29 16:27             ` Florian Hars
2003-10-24  9:25     ` Hendrik Tews
2003-10-24 16:23       ` Dustin Sallings

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20031023233239.GA4477@davidb.org \
    --to=caml-list@davidb.org \
    --cc=caml-list@inria.fr \
    --cc=dustin@spy.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).