[plt-scheme] Closures

From: Joel J. Adamson (jadamson at partners.org)
Date: Mon Nov 5 14:40:52 EST 2007

hendrik at topoi.pooq.com writes:

> Ah.  Let's say you're a function.

"Your immune system is like an army..."

> Now this package of code-plus-environment, which closes off all the 
> dangling reference a function might have, is called a closure.  
> Abd indeed, because it is the closure of a function you can call it.

Okay, I have not read the materials Matthias or Shriram suggested, so
I'm still naïve about this: this makes sense, however, from your
description you (the programmer) call the function, right?  The
environment exists (it's there), but you don't invoke an environment.
If you can, however, that's pretty cool and please tell me about it ;)

> I don't even know if Scheme has any kinds of closures that can't be 
> called.  I don't know of any.  So if your frame-sets are different 
> (you seem to think they can't be called) perhaps you could give me an 
> intuitive explanation what *they* are.

Just to clarify, I'm not dealing with a specific problem, I'm just
always looking for more ways to "think in Scheme."

Thanks, this definitely helps,
Joel


-- 
Joel J. Adamson
Biostatistician
Pediatric Psychopharmacology Research Unit
Massachusetts General Hospital
Boston, MA  02114
(617) 643-1432
(303) 880-3109


The information transmitted in this electronic communication is intended only for the person or entity to whom it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this information in error, please contact the Compliance HelpLine at 800-856-1983 and properly dispose of this information.


Posted on the users mailing list.