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 VAA21486; Tue, 16 Apr 2002 21:27:14 +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 VAA20116 for ; Tue, 16 Apr 2002 21:27:13 +0200 (MET DST) Received: from mail-blue.research.att.com (mail-blue.research.att.com [135.207.30.102]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g3GJRC522461 for ; Tue, 16 Apr 2002 21:27:12 +0200 (MET DST) Received: from sprache.sage.att.com (sprache.sage.att.com [135.207.29.235]) by mail-blue.research.att.com (Postfix) with ESMTP id 4464B4CFBF for ; Tue, 16 Apr 2002 15:26:08 -0400 (EDT) Received: from sage.att.com (kestrel.sage.att.com [135.207.29.159]) by sprache.sage.att.com (980427.SGI.8.8.8/8.8.7) with ESMTP id PAA13084 for ; Tue, 16 Apr 2002 15:26:07 -0400 (EDT) Message-ID: <3CBC7ACF.1BAF3898@sage.att.com> Date: Tue, 16 Apr 2002 15:26:07 -0400 From: Garry Hodgson Organization: AT&T Labs X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.4.2-2 i686) X-Accept-Language: en MIME-Version: 1.0 To: ocaml Subject: Re: [Caml-list] what does this mean? References: <3CBC5F37.1DC83003@sage.att.com> <20020416180611.GB586@cmu.edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk "Eric C. Cooper" wrote: > > On Tue, Apr 16, 2002 at 01:28:23PM -0400, Garry Hodgson wrote: > > > > i'm getting en error message i don't understand in the following code > > fragment. foo.ml is: > > > > let regions = Hashtbl.create 64 > > > > type region = { name:string; coords:(int*int*int*int); countries:string > > list } > > > > let addRegion name0 coords0 ccs = > > let r = { name=name0; coords=coords0; countries=ccs } in > > Hashtbl.add regions name0 r > > > > when i comp[ile, i get: > > > > $ ocamlc foo.ml > > File "foo.ml", line 9, characters 13-20: > > This expression has type ('a, 'b) Hashtbl.t but is here used with type > > (string, region) Hashtbl.t > > The type constructor region would escape its scope > > > > can someone explain what this means, and perhaps how to resolve it? > > thanks > > The problem is that you create the regions hash table before defining > the region type. Just move the type definition to the top, before > creating any data structures that might use it. that was it. my thanks, to you and the others who pointed this out in email. -- Garry Hodgson Let my inspiration flow Senior Hacker in token rhyme suggesting rhythm Software Innovation Services that will not forsake me AT&T Labs 'til my tale is told and done. garry@sage.att.com ------------------- 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