Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Xavier Leroy <Xavier.Leroy@inria.fr>
To: Anton Moscal <msk@post.tepkom.ru>, caml-list@inria.fr
Subject: Re: Local definitions
Date: Mon, 12 Oct 1998 13:39:03 +0200	[thread overview]
Message-ID: <19981012133903.58898@pauillac.inria.fr> (raw)
In-Reply-To: <Pine.LNX.4.03.9810051823001.28401-100000@post.tepkom.ru>; from Anton Moscal on Mon, Oct 05, 1998 at 06:27:18PM +0400

> Why CaML doesn't not allow the following style of local definitions:
> [...]
> or, the second variant: simply allow declaration of
> types, exceptions, open statements and others in "let-in"
> expressions with the same translation:

I think types and exceptions are best handled at the level of
modules, if necessary by creating a sub-structure to restrict their scope.

I've never found a convincing example of a type or exception
declaration local to an expression.

It is true that "let module ... in <expr>" lets you achieve the same
effect, but that's really not the intended use of "let module", which
is to allow functor applications to structures whose value components
may depend on function parameters.

> This syntax allow more convenient notation for local types,
> classes, exceptions and others definitions, than explicit usage of 
> local modules.

This is true, but I'd still recommend that you don't use types,
classes and exceptions local to an expression.  The module system
handles this just fine.

Best regards,

- Xavier Leroy





  reply	other threads:[~1998-10-12 16:51 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-09-21 16:30 polymorphic recursion Peter J Thiemann
1998-09-22  2:33 ` Jacques GARRIGUE
1998-09-22  9:22   ` Pierre Weis
1998-09-22 10:00     ` Simon Helsen
1998-09-22 15:06       ` Pierre Weis
1998-09-22 15:28         ` Simon Helsen
1998-09-22 16:33           ` Pierre Weis
1998-09-22 15:50         ` Pierre CREGUT - FT.BD/CNET/DTL/MSV
1998-09-22 17:14           ` Xavier Leroy
1998-09-28  9:51             ` Pierre Weis
1998-09-28 11:45               ` Peter Thiemann
1998-09-28 13:00                 ` Pierre Weis
1998-10-05 14:27               ` Local definitions Anton Moscal
1998-10-12 11:39                 ` Xavier Leroy [this message]
1998-10-12 17:20                   ` Adam P. Jenkins
1998-10-14 13:47                   ` Anton Moscal

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=19981012133903.58898@pauillac.inria.fr \
    --to=xavier.leroy@inria.fr \
    --cc=caml-list@inria.fr \
    --cc=msk@post.tepkom.ru \
    /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