<?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/07/a7dc933f5630b69d8aaaade2b2a1795a"
  from="ronniec95@l..."
  author="ronniec95@l..."
  date="2003-07-15T08:23:57"
  subject="[Caml-list] Queue example"
  prev="2003/07/32a40dd0400e6e67ba0420eff5aa16c3"
  next="2003/07/60c6d7ad3b5ec540693e715f5cd58d77"
  next-in-thread="2003/07/60c6d7ad3b5ec540693e715f5cd58d77"
  prev-thread="2003/07/f087c018f2b5dd9d20cee1fec0e2932e"
  next-thread="2003/07/e481e02b272f5f354af206fd1dc9148b"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] Queue example">
<msg 
  url="2003/07/a7dc933f5630b69d8aaaade2b2a1795a"
  from="ronniec95@l..."
  author="ronniec95@l..."
  date="2003-07-15T08:23:57"
  subject="[Caml-list] Queue example">
<msg 
  url="2003/07/60c6d7ad3b5ec540693e715f5cd58d77"
  from="Pierre Weis &lt;pierre.weis@i...&gt;"
  author="Pierre Weis"
  date="2003-07-15T08:29:01"
  subject="Re: [Caml-list] Queue example">
</msg>
</msg>
</thread>

<contents>
Hi,

I'm just trying to figure out how to create a queue of a specific type in
a .ml file. I can do it in the interpreter as:

&gt;let q = Queue.create()
&gt;Queue.add 1 q 

This creates an int queue.

Declaring this in a .ml file gives 

The type of this expression, '_a Queue.t,
contains type variables that cannot be generalized


I know you can construct a Queue and put an item in it straight away to
specify the type, but I want an empty queue to start with; eg like std::queue&lt;int&gt;
from c++.

Any help appreciated.

Thanks.

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

