Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!sdd.hp.com!elroy.jpl.nasa.gov!lll-winken!sun-barr!newstop!sun!morocco!landauer From: landauer@morocco.Sun.COM (Doug Landauer) Newsgroups: comp.lang.c++ Subject: classes within functions (was Re: Scoping Bug) Message-ID: <134404@sun.Eng.Sun.COM> Date: 12 Apr 90 21:23:35 GMT References: <36159@brunix.UUCP> <1283@crabcake> Sender: news@sun.Eng.Sun.COM Reply-To: landauer@sun.UUCP (Doug Landauer) Organization: Sun Microsystems, Mountain View Lines: 24 > Personally, I believe the local class in C++ is a kind of tradeoff of > limited levels of lexical scoping (at most two levels) and consistency > with C programming. 1. The term "local class" is ambiguous (can mean class-within-function, or class-within-class), and should not be used. 2. The "local class" you're talking about (class-within-function) is a direct result of C compatibility (struct-within-function must be allowed) versus self-consistency (struct == class { public: ... }). It should not be used (except in existing C code). 3. The other "local class" (class-within-class) changes meanings drastically as of cfront 2.1 and/or X3J16 and/or BS's forthcoming book, so it too should not be used (at least wait until next year). Conclusion: The ambiguous term "local class" is an epithet in C++ any way you translate it. -- Doug Landauer - Sun Microsystems, Inc. - Languages - landauer@eng.sun.com Matt Groening on C++: "Our language is one great salad." -- Disclaimer: I was just kidding about not using them. They're just a few more mines to step in.