home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.std.c++
- Path: sparky!uunet!munnari.oz.au!metro!extro.ucc.su.OZ.AU!maxtal
- From: maxtal@extro.ucc.su.OZ.AU (John MAX Skaller)
- Subject: Re: Zero-length structures and pointer comparisons
- Message-ID: <1992Dec12.162211.5076@ucc.su.OZ.AU>
- Sender: news@ucc.su.OZ.AU
- Nntp-Posting-Host: extro.ucc.su.oz.au
- Organization: MAXTAL P/L C/- University Computing Centre, Sydney
- References: <9234601.10277@mulga.cs.mu.OZ.AU> <1992Dec11.231131.10956@microsoft.com> <24392@alice.att.com>
- Date: Sat, 12 Dec 1992 16:22:11 GMT
- Lines: 51
-
- In article <24392@alice.att.com> ark@alice.UUCP () writes:
- >In article <1992Dec11.231131.10956@microsoft.com> jimad@microsoft.com (Jim Adcock) writes:
- >
- >> So that taking the address of a nested function in different scopes
- >> causes differing trampolines to be created, and differing pointers returned?
- >
- >It shouldn't need to do that. At most one trampoline is ever necessary
- >for a given nested function during its lifetime, namely the one that
- >binds the lexically surrounding context that was current when the
- >block containing the definition of that function was entered.
-
- Are you saying that if I have a recursive function with a nested
- function in it, and store the address of the nested function in scope
- at the time of entering the n'th recursion into an array in slot n,
- then executing the j'th slot will access the n'th activation record
- and not the j'th one? (I.e. all the functions in the array
- access the most recent activation record?)
-
- >
- >Moreover, that trampoline address is unique until the corresponding
- >function has gone out of scope, at which point the address is moot.
-
- Irrespective of how it is implemented, and even if
- taking the address of a nested function is allowed, I would like
- to see C++ allow nested functions.
-
- There are several levels to which this could be done:
-
- 1) Same as non-nested function: no access to environment,
- BUT the name is function local, also no address taking.
-
- 2) Allow access to environment, but not taking address.
-
- 3) Full hog: allow address taking.
-
- One could also restricted nesting to one level.
-
- Andrew,
- Would any of these be likely to be accepted by the committee?
- Do you personally favour nested functions?
- If not, why not?
- Anyone else? Anyone with GNU actually using them?
- Anyone hate them?
-
-
-
- --
- ;----------------------------------------------------------------------
- JOHN (MAX) SKALLER, maxtal@extro.ucc.su.oz.au
- Maxtal Pty Ltd, 6 MacKay St ASHFIELD, NSW 2131, AUSTRALIA
- ;--------------- SCIENTIFIC AND ENGINEERING SOFTWARE ------------------
-