From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id D13CE7EEBF for ; Wed, 19 Aug 2015 17:48:07 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of hendrik@topoi.pooq.com) identity=pra; client-ip=69.165.131.134; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="hendrik@topoi.pooq.com"; x-sender="hendrik@topoi.pooq.com"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of hendrik@topoi.pooq.com) identity=mailfrom; client-ip=69.165.131.134; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="hendrik@topoi.pooq.com"; x-sender="hendrik@topoi.pooq.com"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@april.topoi.pooq.com) identity=helo; client-ip=69.165.131.134; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="hendrik@topoi.pooq.com"; x-sender="postmaster@april.topoi.pooq.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CiCwBTpNRV/4aDpUVdg29EASStEJI7hXsCgg4BAQEBAQGBC4QjAQEBAwE6NBALCwcRCQQhDwUYGT2IBwMKCA3LMQOFYQEBAQcCAR+LU4URF4MBgRQFhWwMjByDEIUEh2YDT3tGg2aUOyaEGSIzAYJLAQEB X-IPAS-Result: A0CiCwBTpNRV/4aDpUVdg29EASStEJI7hXsCgg4BAQEBAQGBC4QjAQEBAwE6NBALCwcRCQQhDwUYGT2IBwMKCA3LMQOFYQEBAQcCAR+LU4URF4MBgRQFhWwMjByDEIUEh2YDT3tGg2aUOyaEGSIzAYJLAQEB X-IronPort-AV: E=Sophos;i="5.15,710,1432591200"; d="scan'208";a="143238086" Received: from topoi.pooq.com (HELO april.topoi.pooq.com) ([69.165.131.134]) by mail3-smtp-sop.national.inria.fr with ESMTP; 19 Aug 2015 17:47:59 +0200 Received: by april.topoi.pooq.com (Postfix, from userid 1001) id BC4D71A0272; Wed, 19 Aug 2015 11:47:51 -0400 (EDT) Date: Wed, 19 Aug 2015 11:47:51 -0400 From: Hendrik Boom To: caml-list@inria.fr Message-ID: <20150819154751.GA31044@topoi.pooq.com> References: <20150819135526.GA2204@Magus.sf-private> <55D48F0E.4050604@coherentgraphics.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55D48F0E.4050604@coherentgraphics.co.uk> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [Caml-list] destructive local opens On Wed, Aug 19, 2015 at 03:13:34PM +0100, John Whitington wrote: > Hi, > > Oleg wrote: > >[Since this discussion still continues, I think I will comment on > >Gabriel's comment after all.] > > > > "It is remarkable that programming languages have avoided introducing > > explicit weakening (the popping of a symbol out of scope) for now, and > > I think it is a property that should be preserved. We're not yet ready > > to go there." > > > >Actually there have been proposals to go into that direction, about 30 > >years ago. > > > > http://research.microsoft.com/lampson/39-Pebble/39-PebbleAbstract.htm > > > >Please look at p 287 of the paper: ``Pebble also has an anti-LET, > >which impoverishes the environment instead of enriching it.'' This is > >exactly the issue under discussion in this thread. > > I've sometimes thought it would be nice to be able to write something like: > > let x = f a b c > and y = g d e in > let x' for x y = x * 2 + y in > (x', h x') > > where "let x' for x y" introduces the binding of x' and takes x and > y out of scope. Now, if we accidentally write... > > let x = f a b c > and y = g d e in > let x' for x, y = x * 2 + y in > (x', h x) > > ...we would get an error, since x is out of scope on the last line. This is very explicit about what it allows and shadows. I like it. > You could imagine also "let x' for _ = ... in ..." which removes all > variables in the current scope used in the calculation of x' from > scope, which could be determined syntactically. This seems > draconian, though. > This is possibly less useful. > John > > -- > John Whitington > Director, Coherent Graphics Ltd > http://www.coherentpdf.com/ > > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs