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 SAA25189; Wed, 16 Apr 2003 18:00:12 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA24907 for caml-list@pauillac.inria.fr; Wed, 16 Apr 2003 18:00:11 +0200 (MET DST) 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 WAA28432 for ; Sat, 12 Apr 2003 22:36:52 +0200 (MET DST) Received: from smtp.web.de (smtp02.web.de [217.72.192.151]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h3CKap928669 for ; Sat, 12 Apr 2003 22:36:51 +0200 (MET DST) Received: from [213.6.70.208] (helo=wiko) by smtp.web.de with smtp (WEB.DE(Exim) 4.97 #53) id 194Rjv-0003rL-00; Sat, 12 Apr 2003 22:36:43 +0200 Message-ID: <001f01c30133$4995cda0$d04606d5@wiko> From: "Andreas Rossberg" To: "Jean-Christophe Filliatre" , "Lukasz Lew" Cc: References: <16019.48771.767140.795030@gargle.gargle.HOWL> Subject: Re: [Caml-list] Feature request. Date: Sat, 12 Apr 2003 22:35:49 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Spam: no; 0.00; rossberg:01 caml-list:01 filliatre:01 lri:01 soundness:01 datatypes:01 sml':01 datatype:01 generative:01 escapes:01 modelled:01 unsound:01 trade-off:01 compiler:01 semantics:01 X-Spam: no; 0.00; rossberg:01 caml-list:01 filliatre:01 lri:01 soundness:01 datatypes:01 sml':01 datatype:01 generative:01 escapes:01 modelled:01 unsound:01 trade-off:01 compiler:01 semantics:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Jean-Christophe Filliatre wrote: > > > I found that it would be usefull if some of the language constructions > > could be made localy. For example "open ... in" or "type ... in". > > Why "open in" isn't in standard parser? > > > > Why some constructions are restricted to global (module) use? > > Be aware that it may easily lead to scope issues. > > In SML, there used to be local exceptions (exception E in ...) and it > was breaking type soundness, since an exception could obviously escape > the scope of its declaration (unless the compiler is doing a static > analysis over exceptions possibly raised, difficult yet feasible, but > SML was not). Local exceptions are still allowed in SML and never raised any soundness issue. You probably mean local datatypes, for which there indeed was an issue in SML'90, in that the language spec allowed an expression like let datatype t = C in C end where the generative type t escapes its scope. Due to the way generativity and datatypes were modelled in the semantics, this was unsound. SML'97 does properly restrict the scope of local type names (i.e. the type of a let body is not allowed to mention local type names). > I guess that with a "type ... in" construct, a type could probably > escape its scope the same way, leading to serious issues in assigning > legal types to expressions. All these problems already occur (and are solved) for local modules in OCaml. I believe adding "let type" or "let exception" is merely a question of finding a good trade-off between language economics on one hand and uniformity on the other. - Andreas ------------------- 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