Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Object subclass: #Coroutine
- instanceVariableNames: 'aContinuation'
- classVariableNames: ''
- category: 'PracticaCAP'
- maker: aBlock
- ^ self new maker: aBlock
- maker: aBlock
- | x |
- x := [ :aDestination :aParameter |
- (Continuation callcc: [ :k | aContinuation := k. aDestination value: aParameter. ]).].
- aBlock value: x value: (Continuation callcc: [ :k | aContinuation := k. ^ self. ]).
- value: aValue
- aContinuation value: aValue.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement