<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -76,3 +76,45 @@ for BEGIN and IF; later, other special forms may follow. According to R*RS,
 the last expression inside a lambda body is also in tail position, but in our
 implementation lambda bodies can only contain one expression, so it doesn't
 apply here. (For multiple expressions use BEGIN, which *does* use TCO.)
+
+#
+# CONTINUATIONS
+
+Work like this:
+
+(+ 1 (call/cc (lambda (k) (+ 2 (k 3)))))
+($$ 1 (call/cc ...)) +
+(&lt;+&gt; $$ (call/cc ...)) 1
+(&lt;+&gt; 1 $$) (call/cc (lambda (k) (+ 2 (k 3))))
+(&lt;+&gt; 1 $$) ($$ (lambda (k) (+ 2 (k 3)))) call/cc
+(&lt;+&gt; 1 $$) (&lt;call/cc&gt; $$) (lambda (k) (+ 2 (k 3)))
+(&lt;+&gt; 1 $$) (&lt;call/cc&gt; $$) &lt;lambda&gt;
+(&lt;+&gt; 1 $$) (&lt;call/cc&gt; &lt;lambda&gt;)
+
+At this point, we execute (&lt;call/cc&gt; &lt;lambda&gt;)...
+
+Now what? 
+- We create a continuation (i.e. a snapshot of the current stack)
+- We create a function that takes an argument x, and that, when called, restores
+  the call stack to the snapshot stored in the continuation, and then returns x
+- We replace the (&lt;call/cc&gt; &lt;lambda&gt;) with the lambda body, associated
+  with an environment which has the lambda's variable bound to said function
+
+(&lt;+&gt; 1 $$) (+ 2 (k 3))    with k = {continuation}
+(&lt;+&gt; 1 $$) ($$ 2 (k 3)) +
+(&lt;+&gt; 1 $$) (&lt;+&gt; $$ (k 3)) 2
+(&lt;+&gt; 1 $$) (&lt;+&gt; 2 $$) (k 3)
+(&lt;+&gt; 1 $$) (&lt;+&gt; 2 $$) ($$ 3) k
+(&lt;+&gt; 1 $$) (&lt;+&gt; 2 $$) ({cont} $$) 3
+(&lt;+&gt; 1 $$) (&lt;+&gt; 2 $$) ({cont} 3)
+
+At this point, we're ready to call (k 3). As said, it restores the stack to
+the way it was, then collapses the value 3. So:
+
+(&lt;+&gt; 1 $$) 3
+(&lt;+&gt; 1 3)
+=&gt; 4
+
+The other, partially evaluated expressions, DO NOT MATTER as soon as we call
+(k 3). 
+</diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -39,8 +39,7 @@ TODO:
 - Rewrite some parts in a more functional style, esp. where we change
   expressions in place (placeholder etc).  Instead, we may be able to
   just use a new expression.  That way, we won't have to use copy.deepcopy...
-- Add a few more special forms like AND and OR
-- Continuations?
+- Add a few more special forms like QUOTE, AND and OR
 
 &quot;&quot;&quot;
 </diff>
      <filename>dollop.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>642c20837de9469778d68a26962a3fe2a460ce51</id>
    </parent>
  </parents>
  <author>
    <name>Hans Nowak</name>
    <email>zephyrfalcon@gmail.com</email>
  </author>
  <url>http://github.com/zephyrfalcon/dollop/commit/5a9d5ec3aa4a34adf12a70c82beb107993e8e82c</url>
  <id>5a9d5ec3aa4a34adf12a70c82beb107993e8e82c</id>
  <committed-date>2009-06-16T19:36:09-07:00</committed-date>
  <authored-date>2009-06-16T19:36:09-07:00</authored-date>
  <message>add some comments/docs for clarification</message>
  <tree>008ae0a2c766b9387dc1622f2eda917439680906</tree>
  <committer>
    <name>Hans Nowak</name>
    <email>zephyrfalcon@gmail.com</email>
  </committer>
</commit>
