Back: ContextPart-security checks Up: Base classes Forward: Continuation class-instance creation   Top: GNU Smalltalk Library Reference Contents: Table of Contents Index: Class index About: About this document

1.41 Continuation

Defined in namespace Smalltalk
Superclass: Object
Category: Language-Implementation
At my heart, I am something like the goto instruction; my creation sets the label, and my methods do the jump. However, this is a really powerful kind of goto instruction. If your hair is turning green at this point, don't worry as you will probably only deal with users of continuations, rather than with the concept itself.

1.41.1 Continuation class: instance creation  (class)
1.41.2 Continuation: invocation  (instance)


1.41.1 Continuation class: instance creation

current
Return a continuation.

currentDo: aBlock
Pass a continuation to the one-argument block, aBlock and return the result of evaluating it.

escapeDo: aBlock
Pass a continuation to the one-argument block, knowing that aBlock does not fall off (either because it includes a method return, or because it yields control to another continuation). If it does, an exception will be signalled and the current process terminated.


1.41.2 Continuation: invocation

callCC
Activate the original continuation, passing back in turn a continuation for the caller. The called continuation becomes unusable, and any attempt to reactivate it will cause an exception. This is not a limitation, in general, because this method is used to replace a continuation with another (see the implementation of the Generator class).

oneShotValue
Return nil to the original continuation, which becomes unusable. Attempting to reactivate it will cause an exception. This is an optimization over #value.

oneShotValue: v
Return anObject to the original continuation, which becomes unusable. Attempting to reactivate it will cause an exception. This is an optimization over #value:.

value
Return nil to the original continuation, copying the stack to allow another activation.

value: anObject
Return anObject to the original continuation, copying the stack to allow another activation.

valueWithArguments: aCollection
Return the sole element of aCollection to the original continuation (or nil if aCollection is empty), copying the stack to allow another activation



Back: Continuation class-instance creation Up: Continuation Forward: CPtr   Top: GNU Smalltalk Library Reference Contents: Table of Contents Index: Class index About: About this document


This document was generated on July, 23 2009 using texi2html