🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #2402

Re: functions within functions

#2402
From: John F Haugh II
Date: Mon, 11 Feb 1991 14:13
25 lines
1863 bytes
In article <1991Feb11.090514.5736@ithaca.uucp> garry@ithaca.uucp (Garry Wiegand) writes:
>I have seen the innards of compilers like the old 'pcc': they are
>really badly written, with lots of mode variables declared globally.
>*Not* structured/modular/defensive. In a well-written compiler you
>would probably have to make an extra check to *disallow* functions-
>in-functions. 

I would say a well written compiler would still have to add something
to permit function definitions within a function.

There are definitions which are not permitted inside of a function,
such as definitions containing initialized aggregates, as well as
ones which are forbade outside of functions, such as automatic
variables (does anyone use "auto" anymore???)

If the parser does not faithfully implement the syntax of the language,
I'd say something is seriously wrong, even if the code is "structured",
or whatever.  The syntax elements <function-definition> and
<automatic-variable-definition> had best not be lumped into the single
syntax element <some-kind-of-definition>.
-- 
John F. Haugh II                             UUCP: ...!cs.utexas.edu!rpp386!jfh
Ma Bell: (512) 832-8832                           Domain: jfh@rpp386.cactus.org
"I've never written a device driver, but I have written a device driver manual"
                -- Robert Hartman, IDE Corp.
Technical Details
Message-ID: <19047@rpp386.cactus.org>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!cs.utexas.edu!execu!sequoia!rpp386!jfh
References: <1991Feb11.090514.5736@ithaca.uucp>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!cs.utexas.edu!execu!sequoia!rpp386!jfh
From: jfh@rpp386.cactus.org (John F Haugh II)
Newsgroups: comp.std.c
Subject: Re: functions within functions
Message-ID: <19047@rpp386.cactus.org>
Date: 11 Feb 91 14:13:18 GMT
References: <1991Feb11.090514.5736@ithaca.uucp>
Reply-To: jfh@rpp386.cactus.org (John F Haugh II)
Organization: Lone Star Cafe and BBS Service
Lines: 25
X-Clever-Slogan: Recycle or Die.