ContextScheme is an implementation of some of the essential ideas of
Context-oriented Programming. It roughly relates to ContextL [1] like
Tiny CLOS relates to CLOS. More specifically, ContextScheme is
independent of any object-oriented extension, so it illustrates only the
essential ideas of dynamic layer activation and deactivation.
There are two implementations: ContextScheme provides layers and layered
functions along with layer activation and deactivation.
SimpleContextScheme provides layers and layered functions, but only
layer activation, no layer deactivation. The reason for providing two
different implementations is that layer deactivation adds some
considerable complexity at the implementation-level, so
SimpleContextScheme is probably easier to understand at first.
Both implementations have been tested against R5RS Scheme. In the
comments, you can find some workarounds for potentially missing Scheme
features (namely: multiple values, dynamic-wind and syntax-rules). The
source code also contains a few obscure test cases, as well as a simple
example.
You can find good introductions to Context-oriented Programming at
http://p-cos.net/documents/contextl-overview.pdf and
http://www.jot.fm/issues/issue_2008_03/article4/ - papers about some
advanced topics can be found at http://p-cos.net/research.html
The code for ContextScheme comes with a BSD/MIT-style license. Please
send questions and comments to me.
Pascal
[1] http://common-lisp.net/project/closer/contextl.html
--
My website: http://p-cos.net
Common Lisp Document Repository: http://cdr.eurolisp.org
Closer to MOP & ContextL: http://common-lisp.net/project/closer/