From 8508968508022394699
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,ac06fef48c3c04df
X-Google-Attributes: gidf78e5,public
X-Google-Thread: 109fba,ac06fef48c3c04df
X-Google-Attributes: gid109fba,public
X-Google-ArrivalTime: 1995-01-25 08:40:44 PST
Path: pad-thai.cam.ov.com!bloom-beacon.mit.edu!panix!news.mathworks.com!udel!gatech!swrinde!news.uh.edu!uuneo.neosoft.com!sam-slip-i0.NeoSoft.COM!tseaver
From: tseaver@sam.neosoft.com (Tres Seaver)
Newsgroups: comp.lang.c++,comp.std.c++
Subject: Re: friends and local classes
Date: Wed, 25 Jan 1995 09:49:48
Organization: MACRO Enterprises, Inc.
Lines: 33
Message-ID: <tseaver.77.0009D4C4@sam.neosoft.com>
References: <3frgln$deh@senator-bedfellow.MIT.EDU> <3froli$gss@news.panix.com>  <3fskgs$qsg@engnews2.Eng.Sun.COM> <JGEALOW.95Jan22230221@mtl.mit.edu> <3g0kgm$gue@engnews2.Eng.Sun.COM>
NNTP-Posting-Host: sam-slip-i0.neosoft.com
X-Newsreader: Trumpet for Windows [Version 1.0 Rev A]
Xref: pad-thai.cam.ov.com comp.lang.c++:70884 comp.std.c++:9243

In article <3g0kgm$gue@engnews2.Eng.Sun.COM> clamage@Eng.Sun.COM (Steve Clamage) writes:

<snip>

>With namespaces, C++ has so many different kinds of scopes, both
>named and anonymous, that local classes and nested functions seem
>unnecessary. Nevertheless, nested functions allow some powerful
>programming techniques which are otherwise very inconvient.

>Either C++ should have nested functions, or member functions of local
>classes should be disallowed. The current set of rules makes no sense
>(IMHO).
>--
>Steve Clamage, stephen.clamage@eng.sun.com

Bingo!  I have never understood why (except to keep life simple for compiler 
writers) nested functions weren't allowed -- as you say, some techniques 
require, in the absence of nested functions, a ridiculous amount of work.

IMNSHO, the committee would do well to "orthagonalize" the concept of 
scope as far as possible;  it is too late, for this iteration, but the 
"principle of least surprise" is or should be of fairly high priority.

I don't think that complicating things for implementers is a sufficient QED 
for disallowing the concept;  any compiler writer who wants to keep life 
simple had better pick a language without ties to a language with as bizarre a 
grammar and syntax as C's!

=========================================================================
 Tres Seaver,               |  tseaver@neosoft.com
 MACRO Enterprises, Inc.,   |  Vox: (713) 827-7273
 Houston, Texas, USA.       |  Fax: (713) 827-7278
=========================================================================


