Newsgroups: comp.lang.dylan
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!howland.reston.ans.net!ix.netcom.com!netcom.com!gyro
From: gyro@netcom.com (Scott L. Burson)
Subject: Closures vs. instances
Message-ID: <gyroCyoCEC.E91@netcom.com>
Organization: Netcom Online Communications Services (408-241-9760 login: guest)
References: <Pine.A32.3.91.941101135206.21746I-100000@swim5.eng.sematech.org> <398qo7INNl0g@ford.is.wdi.disney.com> <Pine.A32.3.91.941102163106.37864M-100000@swim5.eng.sematech.org>
Date: Thu, 3 Nov 1994 04:27:48 GMT
Lines: 29

In article <Pine.A32.3.91.941102163106.37864M-100000@swim5.eng.sematech.org> "William D. Gooch" <goochb@swim5.eng.sematech.org> writes:
>I think in a "pure" object world, it's pretty hard to argue that there 
>is such a thing as a "first-class" function.  If anyone can present a 
>good argument that such things can exist in pure OO, I'd like to hear it.
>From what I've seen, it seems to me that object purity and function 
>first-classness are mutually exclusive.  In Smalltalk, blocks are the 
>only sort of functional object other than normal methods, and blocks can 
>only be executed via methods.  

Huh.  I don't understand this.  I guess I don't know what "pure" OO is.  To
me, an instance *is* a tuple of closures that all share a common environment.
There are object systems for Scheme that work literally thus.  I have built
instances this way by hand on a couple of occasions when I didn't have access
to a more elaborate object system.

From this point of view, instances and closures are very closely related
things.  The only difference is, loosely speaking, that an instance can do
many things while a closure can do only one thing.  Beyond that I see no
difference -- and that difference itself doesn't strike me as the least bit
fundamental.

To this day I do not understand why evaluating the name of a member function
in C++ doesn't yield a closure... or, more to the point, why the idea that it
*should* yield a closure strikes most C++ aficionados as so heretical.  It is
truly one of the most baffling sociological phenomena I have ever encountered
in the CS community, and leaves me slack-jawed every time I think about it.

-- Scott ("Closures are Cuddly!") Burson

