[squeak-dev] Direct implementation of shift/reset in Smalltalk

Randal L. Schwartz merlyn at stonehenge.com
Thu Apr 21 18:56:08 UTC 2011


>>>>> "Frank" == Frank Shearar <frank.shearar at angband.za.org> writes:

Frank> I finished a preliminary version of the shift/reset control operator for
Frank> creating and using partial continuations:

Frank> http://www.squeaksource.com/Control.html


Frank> It's pretty easy to use:

Frank> [ 1 + 2 ] reset => 3
Frank> [ 1 + [:k | 2 ] shift ] reset => 2 (because k's not used, that part of the
Frank> stack's discarded)
Frank> [ 1 + [:k | k value: 2 ] shift ] reset => 3
Frank> [ 1 + [:k | k value: (k value: 2) ] shift ] reset => 4
Frank> [ 1 + [:k | cont := k. k value: 0 ] shift ] reset => 1, and cont now holds the
Frank> continuation, for later (re-)use.

I have no clue what's going on here, and the "best paper" you link has
greek characters in the second column on the first page.

Can you explain what's happening in English?

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn at stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.posterous.com/ for Smalltalk discussion



More information about the Squeak-dev mailing list