RE: Undefined labels

From: Gerard Huet (Gerard.Huet@inria.fr)
Date: Wed Nov 17 1999 - 10:54:37 MET


Message-Id: <199911171001.LAA26208@yana.inria.fr>
Date: Wed, 17 Nov 1999 10:54:37 +0100
To: Brian Rogoff <bpr@best.com>, caml-list@inria.fr
From: Gerard Huet <Gerard.Huet@inria.fr>
Subject: RE: Undefined labels

At 16:30 15/11/99 -0800, Brian Rogoff wrote:
>On Fri, 12 Nov 1999, Manuel Fahndrich wrote:
>>
>> This is the standard example for why we need a local open in the language.
>>
>> -Manuel
>
>Let me second that motion. Coming from Ada, I always wondered why OCaml
>doesn't allow you to restrict the scope of open, instead of putting it
>always at module level.
>
>-- Brian
>

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.
Things would get worse with a local open. This reminds me of the old days
of Pascal, with the dreadful "with" construction which opened an implicit
scope (the field names of the corresponding record declaration) at this
point in the code. This made the scope structure dependent of the type
analysis in a global way, and thus broke an essential phase distinction for
the compiler. This was the source of unending headaches. For instance, it
was a cause of unnecessary complications in terminal recursion removal,
since the names of the formal parameters of procedures could be hidden at
the point of call by an intermediate with.

GH



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:28 MET