🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #3434

Re: Nested functions (was: Re: GOTO single exit point)

#3434
From: Derick J.R. Qua-Gonzalez
Date: Sun, 24 Sep 1995 04:10
30 lines
1781 bytes
Lawrence Kirby <fred@genesis.demon.co.uk> writes:

>In article <1995Sep22.171416.1574@ittpub> wil@ittpub.nl "Wil Evers" writes:

>>All languages that allow a nested procedure to access the local variables  
>>of the enclosing procedure(s) and use lexical scoping have this problem.  

>Function nesting can be useful for scoping even when local variables of
>enclosing functions are no accessible. If I remember correctly this is
>what BCPL supported. It is a shame that C threw this facility away.

Hey Lawrence...

I completely agree with you that C would have been nice with nested
functions. On a stack-based machine, implementation of the scoping
can be easily done, looking up the call of stack frames.

In C++, the namespace facility comes close.

Best regards,
Derick.

--
+------------------------------------------------------------------------+
| Derick R. Qua-Gonzalez                                      | ________ |
| Department of Physics, California State University          | \      / |
| dqua@dqua.EarthLink.Net                                     |  \    /  |
|     ``It is better to be hated for what one is,             |   \  /   |
|       than loved for what one is not.'' (A. Gide)           | 32 \/ USA|
+-------------------------------------------------------------+----------+
Technical Details
Message-ID: <dqua.811915828@dqua>
Path: arc1-ca.pugleaf.net!nntp.earthlink.net!dqua!dqua
References: <43j992$623@gabi.gabi-soft.fr> <1995Sep22.171416.1574@ittpub> <811806009snz@genesis.demon.co.uk>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!nntp.earthlink.net!dqua!dqua
From: dqua@earthlink.net (Derick J.R. Qua-Gonzalez)
Newsgroups: comp.std.c,comp.lang.c
Subject: Re: Nested functions (was: Re: GOTO single exit point)
Date: 24 Sep 95 04:10:28 GMT
Organization: Earthlink Network, Inc.
Message-ID: <dqua.811915828@dqua>
References: <43j992$623@gabi.gabi-soft.fr> <1995Sep22.171416.1574@ittpub> <811806009snz@genesis.demon.co.uk>
NNTP-Posting-Host: dqua.earthlink.net