[ENH] ContextCleanup-ajh

Anthony Hannan ajhannan at yahoo.com
Tue Jun 24 05:17:42 UTC 2003


ContextCleanup-ajh (previously ContextCleanupPlus-ajh) now only contains
context and exception enhancements.  It exists as an independent package on
SqueakMap.  ClosureCompiler-ajh depends on it.  Below is its description copied
from its Readme file:

Context Control Enhancements - Methods like #return:, #restart, and #jump have
been added to ContextPart for simpler control of the current thread.

Process Control Enhancements - Methods like #completeStep: have been added to
Process for simpler control of suspended processes. 'completeStep: aContext'
will resume the thread them jump back to the triggering thread when aContext
get control back. This allows quick stepping while in the context of the
suspended process (i.e. its exception handlers will be active instead of the
triggering thread's).

Debugger Enhancements - The debugger uses the new process methods described
above.

ContextTags - 'methodContext contextTag' will create a unique ContextTag object
for that methodContext and hold it in its receiverMap instance variable which
was previously unused. Copies of the methodContext will hold the same
contextTag. Holding a contextTag instead of a context directly is safer when
copying contexts (see continuations below). A context for a context tag is
found in the current thread just be traversing the senders until one is found
with that contextTag.

Exceptions Refactored - Exceptions now hold initialContext and handlerContext
tags instead of the actual contexts so contexts can be copied safely (described
above). Also, searching for handler contexts has been simplified utilizing
Context control behavior described above.

Continuations - 'Continuation current' copies thisContext stack and wraps it in
a Continuation object. Also, '[:cc | ...] callCC' copies the sender stack into
a Continuation and returning it. Evaluating a continuation copies the stack
again and resumes that copy. The current process stack is abandoned. When a
BlockContext on the stack is copied it points to copied home context if it is
also on the stack.

Continuation Test Cases - Thanks to Avi Bryant for writing continuation test
cases (ContinuationTest and AmbTest).  One test fails which will succeed when
using closures.

Cheers,
Anthony


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com



More information about the Squeak-dev mailing list