# HG changeset patch # User Claus Gittinger # Date 1374745055 -7200 # Node ID b4d307032579df9016b32ef1e2ab689519220882 # Parent 8e0b933a9d68e7b0eb350b089bee2dea028b7cde class: Continuation comment/format in: #currentDo: changed: #current diff -r 8e0b933a9d68 -r b4d307032579 Continuation.st --- a/Continuation.st Thu Jul 25 11:35:36 2013 +0200 +++ b/Continuation.st Thu Jul 25 11:37:35 2013 +0200 @@ -67,6 +67,8 @@ !Continuation class methodsFor:'instance creation'! current + "this is called current-continuation in scheme" + |cont id| cont := self basicNew. @@ -76,12 +78,12 @@ __cId = __continuationCreate(cont); if (__cId > 0) { - id = __mkSmallInteger(__cId); + id = __mkSmallInteger(__cId); } %}. id isNil ifTrue:[ - self error:'could not create continuation' mayProceed:true. - ^ nil. + self error:'could not create continuation' mayProceed:true. + ^ nil. ]. cont setId:id process:(Processor activeProcess). ^ cont @@ -90,13 +92,16 @@ self current " - "Modified: / 29-11-2006 / 10:12:35 / cg" + "Modified: / 25-07-2013 / 11:37:27 / cg" ! currentDo: aBlock + "this is is called call/cc in scheme" + ^ aBlock value:self current "Modified: / 29-11-2006 / 10:14:03 / cg" + "Modified (comment): / 25-07-2013 / 11:37:00 / cg" ! new @@ -186,5 +191,6 @@ !Continuation class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libbasic/Continuation.st,v 1.15 2008-11-03 11:20:32 stefan Exp $' + ^ '$Header: /cvs/stx/stx/libbasic/Continuation.st,v 1.16 2013-07-25 09:37:35 cg Exp $' ! ! +