Article View: comp.std.c++
Article #1426Re: Proposal for default scope
From: Fergus James HENDERSON
Date: Fri, 08 Jan 1993 06:44
Date: Fri, 08 Jan 1993 06:44
30 lines
1995 bytes
1995 bytes
greg@qualcom.qualcomm.com (Greg Noel) writes:
>In article <mkohtala.726108774@vipunen.hut.fi> Marko.Kohtala@hut.fi suggests
>the use of Class::{ /* ... */ } as syntactic sugar so that class members
>could be defined in the scope without the need to explicitly put the class
>prefix on each member. He argues that this would make the code easier to
>write and maintain.
[...]
>It does have the disadvantage that it makes the language larger. On the
>other hand, it would seem to eliminate the desire, expressed by several
>people, for nested functions. Such nested functions would usually be
>helper functions in the implementation of a class, so by being able to
>expand the class context to include non-nested functions would provide
>an efficient solution.
Many people seem to think that the purpose of nested functions is purely
as encapsulation, a sort of code organization/modularization feature.
While it is true that they do support this form of encapsulation, the
real reason that they are useful is their access to parameters and local
variables, and the fact that their addresses can be passed to any function
that just expects a function parameter.
If a local function never has its address taken, then it does not use
the full power of nested functions.
--
Fergus Henderson fjh@munta.cs.mu.OZ.AU
This .signature virus is a self-referential statement that is true - but
you will only be able to consistently believe it if you copy it to your own
.signature file!
Technical Details
Message-ID:
<9300817.11209@mulga.cs.mu.OZ.AU>Path:
arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!cs.mu.OZ.AU!munta.cs.mu.OZ.AU!fjhReferences:
<mkohtala.726108774@vipunen.hut.fi> <1993Jan8.044714.2027@qualcomm.com>Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c++ Path: arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!cs.mu.OZ.AU!munta.cs.mu.OZ.AU!fjh From: fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON) Subject: Re: Proposal for default scope Message-ID: <9300817.11209@mulga.cs.mu.OZ.AU> Sender: news@cs.mu.OZ.AU Organization: Computer Science, University of Melbourne, Australia References: <mkohtala.726108774@vipunen.hut.fi> <1993Jan8.044714.2027@qualcomm.com> Date: Fri, 8 Jan 1993 06:44:03 GMT Lines: 30