From 3077485391438069077
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,fb1a92fa405c930c
X-Google-Attributes: gidf78e5,public
From: Hyman Rosen <hymie@prolifics.com>
Subject: Re: nested functions
Date: 1999/06/16
Message-ID: <t7hfo9e4dr.fsf@calumny.jyacc.com>#1/1
X-Deja-AN: 490110753
Approved: Fergus Henderson <fjh@cs.mu.oz.au>
References: <7jd4c5$nup$1@nnrp1.deja.com> <7jjjr6$r02$1@nnrp1.deja.com> <7jma5c$i85@abyss.West.Sun.COM> <7jmdcv$a56$1@engnews1.eng.sun.com> <7jrqf5$op5$1@nnrp1.deja.com> <7jrv0r$dfq$1@engnews1.eng.sun.com> <081650426190c69CPIMSSMTPU07@email.msn.com> <7jvhah$5n3$1@engnews1.eng.sun.com>
X-Original-Date: 15 Jun 1999 13:54:24 -0400
Content-Type: text/plain; charset=us-ascii
X-Complaints-To: news@news.unimelb.edu.au
X-Trace: izvestia.its.unimelb.edu.au 929505694 15975 128.250.29.16 (16 Jun 1999 04:01:34 GMT)
Organization: PANIX Public Access Internet and UNIX, NYC
X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUAN2chjOEDnX0m9pzZAQFCqwF/Wg+Y8GavrniqRnT9AWmy8Fs4ezvrqKOq ki5ydPliECS9KAsWOzrpofhaS/hpvNfR =HjeX
Mime-Version: 1.0
User-Agent: Gnus/5.070084 (Pterodactyl Gnus v0.84) Emacs/20.3
NNTP-Posting-Date: 16 Jun 1999 04:01:34 GMT
Newsgroups: comp.std.c++

clamage@eng.sun.com (Steve Clamage) writes:
> Of course it does. That is how you implement a closure. It's
> the one nice feature of local functions for which C++ does
> not already have an equivalent.

No it doesn't. You are confusing closures in garbage-collected languages
with closures in C or C++. In non-garbage-collected languages, stack frames
die when their scope is exited. Period. Local functions which refer to
enclosing variables may be used only while their enclosing scope has not
been exited.

People are asking for local functions in C++ so that they can easily use
STL algorithms without the enormous excess verbiage currently needed.

Only a very small number of people want what you are saying, and some of
those probably don't understand the implications, although I'm sure you do.
---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]



