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 QAA12166 for caml-redistribution; Mon, 18 Oct 1999 16:16:02 +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 QAA23983 for ; Sun, 17 Oct 1999 16:22:40 +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 QAA06879; Sun, 17 Oct 1999 16:22:29 +0200 (MET DST) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id QAA12180; Sun, 17 Oct 1999 16:22:29 +0200 (MET DST) Message-ID: <19991017162229.01608@pauillac.inria.fr> Date: Sun, 17 Oct 1999 16:22:29 +0200 From: Xavier Leroy To: skaller , Manuel Fahndrich Cc: "'caml-list@inria.fr'" Subject: Re: Rebinding exception declarations References: <783D93998201D311B0CF00805FEAA07B7E8F5F@RED-MSG-42> <38065E9C.E03FBF19@maxtal.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Mailer: Mutt 0.89.1 In-Reply-To: <38065E9C.E03FBF19@maxtal.com.au>; from skaller on Fri, Oct 15, 1999 at 08:52:12AM +1000 Sender: weis > 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 = The reason is easy: the syntax and the meaning of the right-hand side depends on the 'kind' of the thing being bound. E.g. "t * t" in the right-hand side can be a product type (for a type t = declaration) or a squaring operation (for a let x = declaration). Even human readers need the initial keyword to know how to make sense of the definition, I guess. > 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). The problem is exactly "semantic issues". We know how to type-check and compile mutually-recursive value definitions, and also mutually-recursive type definitions. Mutual recursion between module definitions, for instance, is a research problem that is still mostly open. Mutual recursion between, say, a module and a class seems at least as problematic. Coming back to Manuel Fähndrich original point on rebinding of exceptions: this looks like a natural thing to have. We can rebind datatype constructors already, so why not exceptions. I'll see what we can do about it. - Xavier Leroy