From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 47824BBAF for ; Thu, 20 Nov 2008 18:55:02 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvECALszJUlDz4HegWdsb2JhbACTWwEBFiK9YIJ8 X-IronPort-AV: E=Sophos;i="4.33,639,1220220000"; d="scan'208";a="17427709" Received: from fettunta.fettunta.org ([67.207.129.222]) by mail2-smtp-roc.national.inria.fr with ESMTP; 20 Nov 2008 18:54:48 +0100 Received: from usha.takhisis.invalid (unknown [10.17.0.18]) by fettunta.fettunta.org (Postfix) with ESMTP id 219C71812E for ; Thu, 20 Nov 2008 17:54:47 +0000 (UTC) Received: by usha.takhisis.invalid (Postfix, from userid 1000) id 359A96875; Thu, 20 Nov 2008 18:54:42 +0100 (CET) Date: Thu, 20 Nov 2008 18:54:42 +0100 From: Stefano Zacchiroli To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] open Module (not?) considered harmful Message-ID: <20081120175442.GA8853@usha.takhisis.invalid> References: <20081120104914.GA14355@usha.takhisis.invalid> <000001c94b03$4f55d4e0$ee017ea0$@com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <000001c94b03$4f55d4e0$ee017ea0$@com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Spam: no; 0.00; zacchiroli:01 zack:01 clashes:01 clashing:01 syntax:01 foo:01 trivial:01 camlp:01 cheers:01 zacchiroli:01 postdoc:01 zack:01 20,:98 dietro:98 c'e:98 On Thu, Nov 20, 2008 at 11:29:44AM -0000, David Allsopp wrote: > > Why? You and others failed me to convince of this. Or, better, I'm > > sure there are problems with that, but they just show deficiencies > > inherited from other parts of the language. > > Consider > > open Array;; > open List;; You are stretching quite a lot what is being proposed. You are deliberately taking two similar modules (two data structure modules, which also happen to be really similar ADTs), and opening them together. Doing that is asking for trouble, the only way to avoid that is forbidding entirely open, which nobody else has proposed either. What is being proposed wrt the Batteries hierarchy is to open module paths, which in most (maybe even all) of the cases just contain other modules. The potential clashes are related to module pairs, and wont exhibit the problem you shown, because the clashing modules will not be union-ed together. One will win over the other. > > > The most straightforward solution to this problem to me looks like > > > providing a syntax equivalent like "from Module import foo, bar" > > > which selectively imports only some identifiers from a given module. > > Which, for values only, is of course a trivial camlp4 > extension... and could be generalised to include type declarations Yes, which is one of the reason while I was proposing it. Still, you did not to comment on whether such an extension (which we already have, thanks to Nicolas) would be a satisfying solution for the open issue, which is basically my position. Cheers. -- Stefano Zacchiroli -o- PhD in Computer Science \ PostDoc @ Univ. Paris 7 zack@{upsilon.cc,pps.jussieu.fr,debian.org} -<>- http://upsilon.cc/zack/ Dietro un grande uomo c'è ..| . |. Et ne m'en veux pas si je te tutoie sempre uno zaino ...........| ..: |.... Je dis tu à tous ceux que j'aime