<?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/11/f20a0593262276f2e924c1c096e6bd35"
  from="Dustin Sallings &lt;dustin@s...&gt;"
  author="Dustin Sallings"
  date="2003-11-05T04:47:28"
  subject="Re: [Caml-list] cadr?"
  prev="2003/11/7d1a89526a373d9c8ad55df4f4d4ad97"
  next="2003/11/7c2a1cb12f95300a9f19c0db7c2ad6e0"
  prev-in-thread="2003/11/7d1a89526a373d9c8ad55df4f4d4ad97"
  prev-thread="2003/11/26590f366f401c39cd62b82a784477dd"
  next-thread="2003/11/e00f3df02875aef67715de70b65c6100"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] cadr?">
<msg 
  url="2003/11/7d1a89526a373d9c8ad55df4f4d4ad97"
  from="Dustin Sallings &lt;dustin@s...&gt;"
  author="Dustin Sallings"
  date="2003-11-05T04:30:58"
  subject="[Caml-list] cadr?">
<msg 
  url="2003/11/f20a0593262276f2e924c1c096e6bd35"
  from="Dustin Sallings &lt;dustin@s...&gt;"
  author="Dustin Sallings"
  date="2003-11-05T04:47:28"
  subject="Re: [Caml-list] cadr?">
</msg>
</msg>
</thread>

<contents>

On Nov 4, 2003, at 20:30, Dustin Sallings wrote:

&gt;
&gt; 	This seems like a stupid question, but in my endless search for 
&gt; performance, I tried converting a hashtbl to an assoc list (since it's 
&gt; only got four predefined elements).  I'm having trouble figuring out 
&gt; what to do with this thing (other than assoc):
&gt;
&gt; 	ocaml

&gt; 	val tmp : (int * string) list =
&gt; 	  [(1, "hi1"); (2, "hi2"); (3, "hi3"); (4, "hi4"); (5, "hi5")]
&gt;
&gt; 	I want to do something like this:
&gt;
&gt; 	List.map (function x -&gt; print_endline(List.nth x 1)) tmp;;
&gt;
&gt; 	What am I missing?

	Props to the cardboard programmer.  It's amazing how you can stare at 
something and not get it until you ask for help.

	I need (k, v) as the argument to my function.

-- 
Dustin Sallings

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

