Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Pierre Weis <Pierre.Weis@inria.fr>
To: skaller@maxtal.com.au (skaller)
Cc: caml-list@inria.fr
Subject: Re: Rebinding exception declarations
Date: Fri, 15 Oct 1999 09:12:07 +0200 (MET DST)	[thread overview]
Message-ID: <199910150712.JAA01968@pauillac.inria.fr> (raw)
In-Reply-To: <38065E9C.E03FBF19@maxtal.com.au> from "skaller" at Oct 15, 99 08:52:12 am

> 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/





  reply	other threads:[~1999-10-15  7:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-10-13 16:59 Manuel Fahndrich
1999-10-14 22:52 ` skaller
1999-10-15  7:12   ` Pierre Weis [this message]
1999-10-17 11:15     ` skaller
1999-10-17 14:22   ` Xavier Leroy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199910150712.JAA01968@pauillac.inria.fr \
    --to=pierre.weis@inria.fr \
    --cc=caml-list@inria.fr \
    --cc=skaller@maxtal.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox