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 KAA22711; Tue, 15 Jul 2003 10:29:01 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id KAA04626 for ; Tue, 15 Jul 2003 10:28:59 +0200 (MET DST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h6F8Swf13185; Tue, 15 Jul 2003 10:28:58 +0200 (MET DST) Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id KAA00943; Tue, 15 Jul 2003 10:28:58 +0200 (MET DST) From: Pierre Weis Message-Id: <200307150828.KAA00943@pauillac.inria.fr> Subject: Re: [Caml-list] Queue example In-Reply-To: <3ED766560004D8BC@mk-cpfrontend-3.mail.uk.tiscali.com> from "ronniec95@lineone.net" at "Jul 15, 103 09:18:41 am" To: ronniec95@lineone.net Date: Tue, 15 Jul 2003 10:28:58 +0200 (MET DST) Cc: caml-list@inria.fr X-Mailer: ELM [version 2.4ME+ PL28 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Loop: caml-list@inria.fr X-Spam: no; 0.00; pierre:01 weis:01 caml-list:01 cristal:01 int:01 declaring:01 explicit:03 interpreter:03 interface:03 let:04 queue:05 constraint:05 variables:06 definition:06 generalized:06 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: [...] > Declaring this in a .ml file gives > > The type of this expression, '_a Queue.t, > contains type variables that cannot be generalized Just add a type constraint to your definition, or add an explicit interface file that defines the type of the queue. let q = (Queue.create() : int Queue.t);; Hope this helps Pierre Weis INRIA, Projet Cristal, Pierre.Weis@inria.fr, http://pauillac.inria.fr/~weis/ ------------------- 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