Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Feature request.
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Alain.Frisch@e...
Subject: Re: [Caml-list] Feature request.
On Wed, 9 Apr 2003, Jean-Christophe Filliatre wrote:

> 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

What kind of type unsoundness ?  A local exception cannot be matched
outside its scope (except by match-all pattern, of course), and that's

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

This is exactly the same issue as for local modules, and OCaml can detect

# let module A = struct type t = X end in A.X;;
This `let module' expression has type A.t
In this type, the locally bound module name A escapes its scope

-- Alain

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: