Xref: utzoo comp.std.c:4229 comp.std.c++:558 Path: 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: 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 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