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 KAA25541; Tue, 15 Jul 2003 10:23:57 +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 KAA04463 for ; Tue, 15 Jul 2003 10:23:56 +0200 (MET DST) Received: from mk-smarthost-4.mail.uk.tiscali.com (mk-smarthost-4.mail.uk.tiscali.com [212.74.114.40]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h6F8NtT13630 for ; Tue, 15 Jul 2003 10:23:55 +0200 (MET DST) Received: from [212.74.114.5] (helo=mk-cpfrontend.uk.tiscali.com) by mk-smarthost-4.mail.uk.tiscali.com with esmtp (Exim 4.14) id 19cL6J-0001SL-C6 for caml-list@inria.fr; Tue, 15 Jul 2003 09:23:55 +0100 Received: from [141.228.156.225] by mk-cpfrontend.uk.tiscali.com with HTTP; Tue, 15 Jul 2003 09:18:41 +0100 Date: Tue, 15 Jul 2003 09:18:41 +0100 Message-ID: <3ED766560004D8BC@mk-cpfrontend-3.mail.uk.tiscali.com> From: ronniec95@lineone.net Subject: [Caml-list] Queue example To: caml-list@inria.fr MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Loop: caml-list@inria.fr X-Spam: no; 0.00; ronniec:01 lineone:01 int:01 declaring:01 interpreter:03 let:04 queue:05 std:05 variables:06 construct:06 generalized:06 specify:06 type:07 i'm:07 creates:10 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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: >let q =3D Queue.create() >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::q= ueue 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