lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Thu, Mar 1, 2012 at 12:32 PM, Alex Queiroz <> wrote:

> On Thu, Mar 1, 2012 at 12:36 PM, Jay Carlson <> wrote:
>> [Smalltalk-80 blocks as closures, ^ as method continuation]

>> This is a particularly mean and nasty question to ask of such a noble
>> language, so implementations generally avoided the question.

> I don't get it. Continuation semantics, although confusing at times,
> is not at all undefined. The given example would return twice, yes.

I think it's reasonable in 2012 (or 1995, or pick a year well after
1975) to explain Smalltalk-80 blocks in terms of closures and
continuations to a computer science audience. But reification of
continuations was considered a weird language theory thing for a long
time. Skimming the ST-80 literature it appears many of the mechanisms
were in place in order to support on-the-spot debugging. They weren't
used in normal code because they were expensive.

We could go ask Dan Ingalls about whether Scheme's continuations were
on his mind. But looking at the Smalltalk HOPL paper, I see something
that looks appropriate for Fabien's point about lambda, the ultimate
attractive nuisance:

"It started to hit home in the Spring of '74 after I taught Smalltalk
to 20 PARC nonprogrammer adults. They were able to get through the
initial material faster than the children, but just as it looked like
an overwhelming success was at hand, they started to crash on problems
that didn't look to me to be much harder than the ones they had just
been doing well on. One of them was a project thought up by one of the
adults, which was to make a little database system that could act like
a card file or rolodex. They couldn't even come close to programming
it. I was very surprised because I "knew" that such a project was well
below the mythical "two pages" for end-users we were working within.
That night I worote it out, and the next day I showed all of them how
to do it. Still, none of them were able to do it by themsleves. Later,
I sat in the room poindering the board from my talk. Finally, I
counted the number of nonobvious ideas in this little program. They
came to 17. And some of them were like the concept of the arch in
building design: very hard to discover, if you don't already know

Even if the implementation were cheap, I think defining the semantics
of blocks in terms of closures and continuations would have been
discarded. I don't know what modern Smalltalk systems do; I believe
most have gone to full closures, but I don't know about continuations.