Article View: comp.std.c
Article #2354Re: functions within functions
From: Roy Johnson
Date: Thu, 31 Jan 1991 17:27
Date: Thu, 31 Jan 1991 17:27
27 lines
1750 bytes
1750 bytes
In article <70282@microsoft.UUCP> jimad@microsoft.UUCP (Jim ADCOCK) writes:
>In article <1991Jan22.081057.8567@ithaca.uucp> garry@ithaca.uucp (Garry Wiegand) writes:
>|When the C standards committee was meeting, did they discuss allowing
>|the declaration of functions within functions? Ie, making:
>|
>|> void outside(void) {
>|> static void inside(void) {}
>|>> inside();
>|> }
>|
>|count as legal C? Neither my quasi-Ansi C nor my g++ compiler will
>|accept it.
>|
>|The name-space advantages should be obvious, and as far as I can
>|see the syntax and semantics are clear and unambiguous, with no
>|unfortunate side effects. (Except: I'm not sure if the word "static"
>|would have any meaning in the context.)
If you're worried about the namespace, just make different code
modules, where the outside() is available to the other modules,
and inside() is only available within outside()'s module.
--
======= !{sun,psuvax1,bcm,rice,decwrl,cs.utexas.edu}!shell!rjohnson =======
"If he exploded, all of Manhattan would be talking in high, squeaky voices
for months!" "Cool." -- When I Was Short
Roy Johnson, Shell Development Company
Technical Details
Message-ID:
<RJOHNSON.91Jan31112739@olorin.shell.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!bcm!shell!shell!rjohnsonReferences:
<1991Jan22.081057.8567@ithaca.uucp> <70282@microsoft.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!bcm!shell!shell!rjohnson From: rjohnson@shell.com (Roy Johnson) Newsgroups: comp.std.c,comp.std.c++ Subject: Re: functions within functions Message-ID: <RJOHNSON.91Jan31112739@olorin.shell.com> Date: 31 Jan 91 17:27:39 GMT References: <1991Jan22.081057.8567@ithaca.uucp> <70282@microsoft.UUCP> Sender: usenet@shell.shell.com (USENET News System) Organization: Shell Development Company, Bellaire Research Center, Houston, TX Lines: 27 In-Reply-To: jimad@microsoft.UUCP's message of 29 Jan 91 01:22:16 GMT