[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-smalltalk] Re: [Q] On Implementing Continuation...
From: |
Paolo Bonzini |
Subject: |
[Help-smalltalk] Re: [Q] On Implementing Continuation... |
Date: |
Tue, 06 Mar 2007 09:00:08 +0100 |
User-agent: |
Thunderbird 1.5.0.10 (Macintosh/20070221) |
I suggest that you replace your Continuation.st with the file
examples/Continuations.st in GNU Smalltalk's distribution, applying this patch
which I just committed to both 2.3 and trunk.
Thanks!
Paolo
--- orig/examples/Continuations.st
+++ mod/examples/Continuations.st
@@ -58,6 +58,12 @@ valueWithArguments: v
!Continuation class methodsFor: 'instance creation'!
+current
+ ^self fromContext: thisContext sender!
+
+currentDo: aBlock
+ ^aBlock value: (self fromContext: thisContext sender)!
+
fromContext: aStack
^self new stack: aStack copyStack! !
@@ -99,6 +105,6 @@ copyStack
ifTrue:[^self copy]
ifFalse: [^self copy parentContext: self parentContext copyStack]! !
-(Continuation factorialExample: 4) printNl!
-(Undeclared.RetryCC value: 10) printNl!
-Undeclared removeKey: #RetryCC!
+"(Continuation factorialExample: 4) printNl!"
+"(Undeclared.RetryCC value: 10) printNl!"
+"Undeclared removeKey: #RetryCC!"