From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id UAA13184 for caml-redistribution; Thu, 18 Nov 1999 20:27:25 +0100 (MET) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id LAA02898 for ; Wed, 17 Nov 1999 11:01:20 +0100 (MET) Received: from yana.inria.fr (yana.inria.fr [128.93.9.62]) by concorde.inria.fr (8.8.7/8.8.7) with ESMTP id LAA23957; Wed, 17 Nov 1999 11:01:13 +0100 (MET) Received: from huet-gera1p (huet-gera2p.inria.fr [128.93.20.113]) by yana.inria.fr (8.8.5/8.8.7) with SMTP id LAA26208; Wed, 17 Nov 1999 11:01:12 +0100 (MET) Message-Id: <199911171001.LAA26208@yana.inria.fr> X-Sender: huet@pop-rocq.inria.fr X-Mailer: QUALCOMM Windows Eudora Pro Version 4.0.2 Date: Wed, 17 Nov 1999 10:54:37 +0100 To: Brian Rogoff , caml-list@inria.fr From: Gerard Huet Subject: RE: Undefined labels References: <783D93998201D311B0CF00805FEAA07B7E8FE5@RED-MSG-42> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: weis 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