Article View: comp.std.c
Article #3432Re: Nested functions (was: Re: GOTO single exit point)
From: John Robert Williams
Date: Fri, 22 Sep 1995 19:20
Date: Fri, 22 Sep 1995 19:20
22 lines
1692 bytes
1692 bytes
<42s5su$4h8@inforamp.net> <42u8sr$hv8@bud.shadow.net> <437fk4$5no@eco.twg.com> <439nh8$p7o@news0.rain.rg.net> <43j992$623@gabi.gabi-soft.fr> Distribution: J. Kanze (kanze@gabi-soft.fr) wrote: > Paul Long (plong@perf.com) wrote: > |> Although there are C-like languages that support nested functions, e.g., > |> Gnu C, I've recently learned that the execution model must change to > |> support them. Not a pretty sight. > I'm curious. In what way must the execution model be changed? I think he may be referring to what must be done to allow recursive nested functions; since local functions have access to their parent's local variables (in Pascal, at least), you would have to always pass a pointer to the parent function's variables as a hidden parameter, much like C++ member functions (actually that gives me a greate idea for implementing nested functions in C++, but that's another thread). -- #define REAL_NAME "John Williams" #define E_MAIL "johnw@jove.acs.unt.edu" #define HOMEPAGE "http://www.unt.edu/~johnw"
Technical Details
Message-ID:
<43v2a8$b2g@hermes.acs.unt.edu>Path:
arc1-ca.pugleaf.net!news.unt.edu!jove!johnwReferences:
<3vn1ht$kj8@martha.utk.edu> <41cke4$gtd@sparcserver.lrz-muenchen.de> <41glno$3a0@caip.rutgers.edu> <41iebe$kec@news0.rain.rg.net> <41pm80$skp@inferno.mpx.com.au> <DE02nC.B58@eskimo.com> <41t0sb$15e@news0.rain.rg.net> <DE6G2z.JJD@crdnns.crd.geShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!news.unt.edu!jove!johnw From: johnw@jove.acs.unt.edu (John Robert Williams) Newsgroups: comp.std.c,comp.lang.c Subject: Re: Nested functions (was: Re: GOTO single exit point) Date: 22 Sep 1995 19:20:40 GMT Organization: University of North Texas Message-ID: <43v2a8$b2g@hermes.acs.unt.edu> References: <3vn1ht$kj8@martha.utk.edu> <41cke4$gtd@sparcserver.lrz-muenchen.de> <41glno$3a0@caip.rutgers.edu> <41iebe$kec@news0.rain.rg.net> <41pm80$skp@inferno.mpx.com.au> <DE02nC.B58@eskimo.com> <41t0sb$15e@news0.rain.rg.net> <DE6G2z.JJD@crdnns.crd.ge NNTP-Posting-Host: jove.acs.unt.edu X-Newsreader: TIN [version 1.2 PL2]