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
RE: Undefined labels
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 1999-11-19 (13:33)
From: David Brown <caml-list@d...>
Subject: RE: Undefined labels
Gerard Huet writes:
 > open is a facility that is convenient to the programmer because the code is
 > uncluttered with long explicit names, but it is of course a source of bugs.
 > The addition of a new binding in a module may change drastically the
 > semantics of modules which open it, in a way that stays unnoticed if types
 > match. 

One feature I like of Python and Erlang is a selective import.  It is
possible to specify only the items that you would like imported from a
module.  If you use the selective open, the open declaration itself
states which symbols come from that module.  Since the scope is
explicit, it makes it easy to tell where something is coming from.

I'm not familiar with the parser too much, but perhaps something like:

open (bleep, bloop, SubMod) Module;;

There probably should also be a way to open all of the constructors of
a type.

Dave Brown