From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,21960280f1d61e84 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: in defense of GC Date: Mon, 05 Feb 2007 19:18:04 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <1169531612.200010.153120@38g2000cwa.googlegroups.com> <1mahvxskejxe1$.tx7bjdqyo2oj$.dlg@40tude.net> <2tfy9vgph3.fsf@hod.lan.m-e-leypold.de> <1g7m33bys8v4p.6p9cpsh3k031$.dlg@40tude.net> <14hm72xd3b0bq$.axktv523vay8$.dlg@40tude.net> <4zwt33xm4b.fsf@hod.lan.m-e-leypold.de> <1j7neot6h1udi$.14vp2aos6z9l8.dlg@40tude.net> <1pzx3y7d2pide.y744copm0ejb$.dlg@40tude.net> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1170721090 30274 192.74.137.71 (6 Feb 2007 00:18:10 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Tue, 6 Feb 2007 00:18:10 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:mc9cmmRnmbH6C6aC0Z8vzftgGEc= Xref: g2news2.google.com comp.lang.ada:8986 Date: 2007-02-05T19:18:04-05:00 List-Id: Ray Blaak writes: > Robert A Duff writes: >> But in the latter, case, the return of Stepper is causing the lifetime >> of an integer VARIABLE (i.e. mutable) to be longer than one might >> suspect for a local variable of Make_A_Stepper. That seems like a >> problem to me. > > Yes, the lifetime is longer (as specified by the programmer) but the global > visibility is not affected -- N still cannot be directly manipulated in a > global sense. My complaint is that it's not specified by the programmer on the declaration of that variable (mutable object). Some nested procedure happens to mention N and that procedure gets returned to a more-global place, dragging N along with it. (Yes of course I understand that "N still cannot be directly manipulated in a global sense.") I've got no problem with passing functions (closures) outward in a functional (no mutable variables) context. - Bob