eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'Continuation':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: Continuation


Inheritance:

   Object
   |
   +--Continuation

Package:
stx:libbasic
Category:
Kernel-Processes
Version:
rev: 1.20 date: 2024/02/09 11:16:16
user: stefan
file: Continuation.st directory: libbasic
module: stx stc-classLibrary: libbasic

Description:


Initial attempt - Unfinished.
Continuations do not work yet - there is more support needed in the VM.

[Instance variables:]

    id                     <SmallInteger>   a unique continuation-id;
                                            Used to identify a corresponding
                                            data-structure in the VM.

    process                <Process>        the process which created this continuation.

[Class variables:]

copyright

COPYRIGHT (c) 2004 by eXept Software AG All Rights Reserved This software is furnished under a license and may be used only in accordance with the terms of that license and with the inclusion of the above copyright notice. This software may not be provided or otherwise made available to, or used by, any other person. No title to or ownership of the software is hereby transferred.

Class protocol:

instance creation
o  current
this is called current-continuation in scheme

Usage example(s):

     self current

o  currentDo: aBlock
this is is called call/cc in scheme

o  new
(comment from inherited method)
return an instance of myself without indexed variables


Instance protocol:

invocation
o  argumentCount
VisualAge/ANSI compatibility

o  numArgs
use argumentCount

** This is an obsolete interface - do not use it (it may vanish in future versions) **

o  value
(comment from inherited method)
return the receiver itself.
This allows every object to be used where blocks or valueHolders
are typically used, and allows for valueHolders and blocks to be
used interchangably in some situations.

Time will show, if this is a good idea or leads to sloppy programming
style ... (the idea was borrowed from the Self language).

WARNING: don't 'optimize' away ifXXX: blocks
(i.e. do NOT replace
foo ifTrue:[var1] ifFalse:[var2]
by:
foo ifTrue:var1 ifFalse:var2
)
- the compilers will only generate inline code for the if,
iff the argument(s) are blocks - otherwise, a true send is
generated.
This 'optimization' will work semantically correct,
but execute SLOWER instead.

Using constants (foo ifTrue:1 ifFalse:2) does not introduce a performance penalty.

o  value: v
self terminate: thisContext.

o  valueWithArguments: v

private
o  terminate: aContext
| context |

private accessing
o  finalize
(comment from inherited method)
this is invoked for executor objects which have been registered
in a Registry, when the original object dies.
Subclasses may redefine this method
This interface is also VW-compatible

o  setId: idArg process: aProcess

restoration
o  restoreValues
| valueStream context |



ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Sat, 21 Dec 2024 16:12:24 GMT