<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2003/10/9e4d0c48d7066d16614195d454ef1c0d"
  from="Dustin Sallings &lt;dustin@s...&gt;"
  author="Dustin Sallings"
  date="2003-10-24T06:54:14"
  subject="Re: [Caml-list] newbie type problem"
  prev="2003/10/1ec46ca647143db0b89bf64b3fe444da"
  next="2003/10/082653152d78e76edce7de62398f8c1f"
  prev-in-thread="2003/10/1ec46ca647143db0b89bf64b3fe444da"
  next-in-thread="2003/10/082653152d78e76edce7de62398f8c1f"
  prev-thread="2003/10/e7f6c0d5605db8954852475f246f1109"
  next-thread="2003/10/ef7ea5a38d2bceb896eb567f1eff1764"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] newbie type problem">
<msg 
  url="2003/10/2e8a6962baf66f1c24c5f132e0e4d98a"
  from="Dustin Sallings &lt;dustin@s...&gt;"
  author="Dustin Sallings"
  date="2003-10-24T06:11:43"
  subject="[Caml-list] newbie type problem">
<msg 
  url="2003/10/1ec46ca647143db0b89bf64b3fe444da"
  from="David Brown &lt;caml-list@d...&gt;"
  author="David Brown"
  date="2003-10-24T06:32:48"
  subject="Re: [Caml-list] newbie type problem">
<msg 
  url="2003/10/9e4d0c48d7066d16614195d454ef1c0d"
  from="Dustin Sallings &lt;dustin@s...&gt;"
  author="Dustin Sallings"
  date="2003-10-24T06:54:14"
  subject="Re: [Caml-list] newbie type problem">
<msg 
  url="2003/10/082653152d78e76edce7de62398f8c1f"
  from="David Brown &lt;caml-list@d...&gt;"
  author="David Brown"
  date="2003-10-24T07:53:03"
  subject="Re: [Caml-list] newbie type problem">
<msg 
  url="2003/10/a7c47b1fe652cbc379e868c63cd6fa6f"
  from="Dustin Sallings &lt;dustin@s...&gt;"
  author="Dustin Sallings"
  date="2003-10-24T08:21:36"
  subject="Re: [Caml-list] newbie type problem">
<msg 
  url="2003/10/f70a630abcb73995f40868e5b4aedd5d"
  from="Andrew Lenharth &lt;andrewl@d...&gt;"
  author="Andrew Lenharth"
  date="2003-10-24T12:50:08"
  subject="Re: [Caml-list] newbie type problem">
<msg 
  url="2003/10/4046091fba633875058f2de17f0ff1e7"
  from="Remi Vanicat &lt;vanicat@l...&gt;"
  author="Remi Vanicat"
  date="2003-10-24T13:21:26"
  subject="Re: [Caml-list] newbie type problem">
</msg>
</msg>
<msg 
  url="2003/10/1271d8cb3491b0027667093a335ee94e"
  from="Florian Hars &lt;hars@b...&gt;"
  author="Florian Hars"
  date="2003-10-29T07:23:31"
  subject="Re: [Caml-list] newbie type problem">
<msg 
  url="2003/10/f070014a1ae9dad3251d6334d87f1555"
  from="Dustin Sallings &lt;dustin@s...&gt;"
  author="Dustin Sallings"
  date="2003-10-29T08:03:55"
  subject="Re: [Caml-list] newbie type problem">
<msg 
  url="2003/10/669fd0c0dff2b0a039406b7cb928916d"
  from="Florian Hars &lt;hars@b...&gt;"
  author="Florian Hars"
  date="2003-10-29T16:27:29"
  subject="Re: [Caml-list] newbie type problem">
</msg>
</msg>
</msg>
</msg>
</msg>
<msg 
  url="2003/10/bc22b36f43b4dd5f6d7af456fd0801fc"
  from="Hendrik Tews &lt;tews@t...&gt;"
  author="Hendrik Tews"
  date="2003-10-24T09:25:16"
  subject="Re: [Caml-list] newbie type problem">
<msg 
  url="2003/10/196dea4817e90f7281ee0ccc73dd15a7"
  from="Dustin Sallings &lt;dustin@s...&gt;"
  author="Dustin Sallings"
  date="2003-10-24T16:23:13"
  subject="Re: [Caml-list] newbie type problem">
</msg>
</msg>
</msg>
</msg>
</msg>
</thread>

<contents>

On Thursday, Oct 23, 2003, at 16:32 US/Pacific, David Brown wrote:

&gt; It is a little hard, since I can't tell what you're trying to 
&gt; represent.
&gt; Also, a hashtable might not be the best data structure.
&gt;
&gt; What information are you trying to keep track of?  A hashtable maps
&gt; objects of one type to another.  If you wanted the pb_counts field to
&gt; map strings to int refs (so you can change the refs), you could use a
&gt;
&gt;    pb_counts: (string, int ref) Hashtbl.t

	Yeah, this is the kind of thing I was looking for.  I tried a variety 
of things I thought looked like this.

&gt; without more information, it is hard to tell if that is what you really
&gt; want.
&gt;
&gt; Ocaml also has arrays, maps, sets, and there are numerous libraries 
&gt; with
&gt; other structures as well.

	When picking up a language, there always seems to be a bit of effort 
required to learn how to read the docs.  The docs for Map are pretty 
much empty, but it does link to the source, which gives me a good idea.

	I'm not sure how to express my data structure...  I'm parsing a log 
file that contains start and stop timestamps for various transaction 
types.  I want to count up the number and total time of each of these 
transactions and group them by timestamp rounded to the nearest five 
minutes.  So, it'd look something like this:

{ 0: &lt;
	pb_counts = { "T1": 23, "T2": 43 }
	pb_times = { "T1": 291, "T2": 92 }
	&gt;
   300: &lt;
	pb_counts = { "T1": 29, "T2": 50 }
	pb_times = { "T1": 202, "T2": 87 }
	&gt;
}

	When I spell it out that way, it looks a little less than optimal.  
However, this is more of a learning tool at this point.

	Thanks for your help.

--
SPY                      My girlfriend asked me which one I like better.
pub  1024/3CAE01D5 1994/11/03 Dustin Sallings &lt;dustin@spy.net&gt;
|    Key fingerprint =  87 02 57 08 02 D0 DA D6  C8 0F 3E 65 51 98 D8 BE
L_______________________ I hope the answer won't upset her. ____________

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

</contents>

</message>

