Full Closures - when do they close?

demiourgos at smalltalk.org demiourgos at smalltalk.org
Mon Jan 31 17:30:50 UTC 2000


On Sun, 30 January 2000, Robert Withers wrote:

> 
> "demiourgos at smalltalk.org" wrote:

[snip]

> 
> -- I'm not sure this answered my question above (but Vassili addressed
> in another post so let's base from there...) but you have raised some
> other interesting issues, I think.  I have recently become familiar with
> Functional Language concepts (HOF, Lazy eval, currying, ...).  One
> interesting aspect was the ability of changing or adding state, in some
> FPLs, would only store a diff to the original, for space complexity
> savings.  That's pretty neat.  I believe that's what you talk about
> below...
> 


[snip]

> >.....Indeed,
> > most programs which use closures make and use one or two in very special
> > and restricted places.
> 
> -- I jive with that.  Program structure should be modelled in classes,
> not anonymous closures or complex exception systems.  However, isn't it
> of benefit to realize full closures?

Well, actually, it depends upon what you're trying to do.  I, in fact,
disagree a bit with Vassili's discussion of shared substructures.
Surely, one can share, with memory savings, when direct assignment
to pointer fields is disallowed.  But allowing it and thereby mutating
shared substructures could be devastating or not, depending upon the
application area.  Again, I came to this from the idea of search and
knowledge spaces in AI, where contexts or closures where intended to
be a "cheap" way of modeling states of the world or knowledge.  In that
limited environment, the idea of closures is a powerful too.  However,
if I were using Smalltalk to do it, I very much would prefer working
within a class that implements it rather than building it into the
VM.  Clearly, one can model these many worlds using many techniques,
and not just those which are realized using the fundamentals of 
the computing environment one is using.

I think, in fact, the closures and contexts discussed thusfar are, 
in terms of realizing programming constructs, an invention comparable
to the conceit in poetry:  They draw attention to themselves and really
don't provide that much benefit, and certainly can be done in other
ways.  Maybe they would be useful if modeling knowledge structures, but
I believe even that business is done in different ways these days.

The only thing I'd like to think about which can be implemented using
these closures is something like the classical coroutine, but even
that doesn't need, IMO, the power of closures to be had.

[snip]

  --jtg



______________________________________________________
Jan Theodore Galkowski      www.smalltalk.org/ 
    http://www.scguild.com/usr/1707I.html 
demiourgos at smalltalk.org  www.marssociety.org/
**********************************************
PGP Key Fingerprint: 2757 F86D AA51 677D 38D7  
                     964B 9A8D 7852 A494 3790
**********************************************
Get my Public Key from my home page at:
   http://home.stny.rr.com/algebraist/
**********************************************

______________________________________________

Get free e-mail at http://www.britannica.com





More information about the Squeak-dev mailing list