Re: Is multi-level function return possible?

Marco van de Voort <marcov@toad.stack.nl>
Fri, 14 Mar 2014 22:59:28 +0000 (UTC)

          From comp.compilers

Related articles
[11 earlier articles]
Re: Is multi-level function return possible? gneuner2@comcast.net (George Neuner) (2014-03-14)
Re: Is multi-level function return possible? marcov@toad.stack.nl (Marco van de Voort) (2014-03-14)
Re: Is multi-level function return possible? gah@ugcs.caltech.edu (glen herrmannsfeldt) (2014-03-14)
Re: Is multi-level function return possible? kaz@kylheku.com (Kaz Kylheku) (2014-03-14)
Re: Is multi-level function return possible? kaz@kylheku.com (Kaz Kylheku) (2014-03-14)
Re: Is multi-level function return possible? gah@ugcs.caltech.edu (glen herrmannsfeldt) (2014-03-14)
Re: Is multi-level function return possible? marcov@toad.stack.nl (Marco van de Voort) (2014-03-14)
Re: Is multi-level function return possible? ian@airs.com (Ian Lance Taylor) (2014-03-14)
Re: Is multi-level function return possible? DrDiettrich1@aol.com (Hans-Peter Diettrich) (2014-03-15)
Re: Is multi-level function return possible? usenet@bitblocks.com (Bakul Shah) (2014-03-15)
Re: Is multi-level function return possible? noitalmost@cox.net (noitalmost) (2014-03-15)
Re: Is multi-level function return possible? anton@mips.complang.tuwien.ac.at (2014-03-16)
Re: Is multi-level function return possible? marcov@toad.stack.nl (Marco van de Voort) (2014-03-16)
[13 later articles]
| List of all articles for this month |
From: Marco van de Voort <marcov@toad.stack.nl>
Newsgroups: comp.compilers
Date: Fri, 14 Mar 2014 22:59:28 +0000 (UTC)
Organization: Stack Usenet News Service
References: 14-03-020 14-03-022 14-03-025 14-03-030 14-03-035
Keywords: Pascal, code, comment
Posted-Date: 15 Mar 2014 10:05:06 EDT

On 2014-03-14, Kaz Kylheku <kaz@kylheku.com> wrote:


>> Standard Pascal did have not have closures: you could pass a function
>> by name as an argument to another, but its definition had to be
>> visible both at the point of passing the name and at the point of
>> invocation [through the aliasing argument].
>
> Okay, forget Pascal then with these bizarre restrictions. Let's
> pretend that "Pascal" really means "GNU C" (with its local functions).


> http://gcc.gnu.org/onlinedocs/gcc/Nested-Functions.html
>
> GNU C has real downard funargs, a.k.a. non escaping closures.
>
> (I thought Pascal was like this; but if not, it's too broken to
> warrant another thought.)
>
> So your comment could have said "your GNU C is showing". :)


Syntax is similar, but most Pascal implementations don't use
trampolines, but simply expand the procedure type to be wider (frame
pointer and address).


Gnu Pascal inherited the C school of thought, and uses trampolines
afaik to keep function pointers (single) pointers at all cost.


The earlier mentioned Delphi anonymous functions (closure-likes)
internally are ref counted interfaces to my best knowledge.


P.s. quickreading your URL I didn't really see if GNU C can have
multiple levels of nesting. Pascal can.
[Yes, it can. -John]


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.