Re: How to implement lexical closures?

glen herrmannsfeldt <gah@ugcs.caltech.edu>
Sun, 16 May 2010 09:00:32 +0000 (UTC)

          From comp.compilers

Related articles
[5 earlier articles]
Re: How to implement lexical closures? grom358@gmail.com (grom) (2010-05-11)
Re: How to implement lexical closures? cr88192@hotmail.com (BGB / cr88192) (2010-05-12)
Re: How to implement lexical closures? gene.ressler@gmail.com (Gene) (2010-05-12)
Re: How to implement lexical closures? gah@ugcs.caltech.edu (glen herrmannsfeldt) (2010-05-13)
Re: How to implement lexical closures? gneuner2@comcast.net (George Neuner) (2010-05-15)
Re: How to implement lexical closures? gneuner2@comcast.net (George Neuner) (2010-05-15)
Re: How to implement lexical closures? gah@ugcs.caltech.edu (glen herrmannsfeldt) (2010-05-16)
Re: How to implement lexical closures? gneuner2@comcast.net (George Neuner) (2010-05-17)
Re: How to implement lexical closures? cfc@shell01.TheWorld.com (Chris F Clark) (2010-05-17)
Re: PL/I, was How to implement lexical closures? genew@ocis.net (Gene Wirchenko) (2010-05-17)
Re: How to implement lexical closures? gah@ugcs.caltech.edu (glen herrmannsfeldt) (2010-05-19)
Re: How to implement lexical closures? anton@mips.complang.tuwien.ac.at (2010-05-20)
| List of all articles for this month |
From: glen herrmannsfeldt <gah@ugcs.caltech.edu>
Newsgroups: comp.compilers
Date: Sun, 16 May 2010 09:00:32 +0000 (UTC)
Organization: Aioe.org NNTP Server
References: 10-05-031 10-05-072 10-05-076 10-05-084 10-05-089
Keywords: storage, symbols
Posted-Date: 16 May 2010 11:35:50 EDT

George Neuner <gneuner2@comcast.net> wrote:
> On Sat, 15 May 2010 03:52:50 -0400, George Neuner
> <gneuner2@comcast.net> wrote:


> Our esteemed moderator wrote:


>>[PL/I doesn't do garbage collection, so you can't use an entry
>>outside the block where its variables were allocated. Looks to
>>me like this came straight out of Algol60. -John]


> Strictly speaking, GC isn't necessary ... if you are masochistic
> enough, closures certainly can be managed manually like any other
> program object.


In PL/I you can assign an ENTRY variable the value of an internal
procedure, and pass it to another procedure. You can then use the
variable until the procedure that assigned it returns.


As S/360 doesn't have a stack, a linked list is used for automatic
variables and save areas.


> In languages like standard Scheme and ML, which have closures but are
> not OO, it is traditional to roll your own objects using closures.


(snip)
R also has closures.


-- glen



Post a followup to this message

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