🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #2413

Re: functions within functions

#2413
From: Garry Wiegand
Date: Mon, 11 Feb 1991 09:05
29 lines
1574 bytes
In article <1991Feb8.232835.19022@watmath.waterloo.edu> datangua@watmath.waterloo.edu (David Tanguay) writes:
>One of the "problems" with adding nested functions to C is the addition
>of a display to access autos in outer scopes. The whole issue could be
>avoided by not having autos imported into functions.
>...
>			b = d+1;	/* is okay */
>			c = 0;	/* error: c is not in scope */

Exactly! Doesn't hurt, gives people like me another level of function
name-scoping, and if at some later time the community wants to add
access to outer autos and parameters ("closure", as someone
explained to me), that would be upward-compatible.

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 wonder how many of the representatives on the standards committee
have "well-written compilers"...

>Additional idea:
>  an auto function is not visible to inner functions, static function is.

Hmmmm...

Garry Wiegand    ---    Ithaca Software, Alameda, California
...!uunet!ithaca!garry, garry%ithaca.uucp@uunet.uu.net
Technical Details
Message-ID: <1991Feb11.090514.5736@ithaca.uucp>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!tmsoft!torsqnt!hybrid!scifi!bywater!uunet!ithaca!garry

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!tmsoft!torsqnt!hybrid!scifi!bywater!uunet!ithaca!garry
From: garry@ithaca.uucp (Garry Wiegand)
Newsgroups: comp.std.c
Subject: Re: functions within functions
Message-ID: <1991Feb11.090514.5736@ithaca.uucp>
Date: 11 Feb 91 09:05:14 GMT
Organization: Ithaca Software
Lines: 29