From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id JAA04489 for caml-redistribution; Fri, 15 Oct 1999 09:18:45 +0200 (MET DST) 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 JAA01030 for ; Fri, 15 Oct 1999 09:12:17 +0200 (MET DST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.8.7/8.8.7) with ESMTP id JAA14305; Fri, 15 Oct 1999 09:12:08 +0200 (MET DST) Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id JAA01968; Fri, 15 Oct 1999 09:12:07 +0200 (MET DST) From: Pierre Weis Message-Id: <199910150712.JAA01968@pauillac.inria.fr> Subject: Re: Rebinding exception declarations To: skaller@maxtal.com.au (skaller) Date: Fri, 15 Oct 1999 09:12:07 +0200 (MET DST) Cc: caml-list@inria.fr In-Reply-To: <38065E9C.E03FBF19@maxtal.com.au> from "skaller" at Oct 15, 99 08:52:12 am X-Mailer: ELM [version 2.4 PL24 ME8] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: weis > Manuel Fahndrich wrote: > > > > While we are at wishing for new features in OCaml, let me add a minor > > feature to the list: > > > > Rebinding of exception declarations. > > Actually, I think there is a more syntactic problem: ocaml uses > special 'kinds' of bindings, for some reason that escapes me: > > type X = .. > class X = .. > exception .. > let X = .. > let rec X = > module X = > > which permit recursion with an 'and' option. Unfortunately, > this syntax does not permit these kinds of bindings to be > mutually recursive (quite aside from the semantic issues). Not aside from, but due to semantic issues. > I find this syntax strange, I would have expected > > let X = > > be enough for all kinds of bindings, determined by the > kind of the right hand side. I understand: you start everything by let and then distinguish the construction you are using by some keyword to determine the kind of the right hand side. It would ressemble something like: let x = type .. let c = class .. let E = exception .. let M = module .. let _ = .. (for expression only) I think the regular syntax of Caml is simpler and more intuitive. Apart from syntax, once more it is a semantic problem: modules are not values, values are not types, exception are not classes, classes are not functors. We prefer to have a direct reflection of these semantics distinctions in the syntax: we hope it may induce a clear distinction in the programmer's ideas. > The distinction between sequential and recursive bindings for > functions seems anomolous [let .. in can be used for that]. It is not anomalous [let .. in cannot be used for that]. This is due to the static binding discipline of Caml. Pierre Weis INRIA, Projet Cristal, Pierre.Weis@inria.fr, http://cristal.inria.fr/~weis/