title: How does the yin-yang puzzle work?
body: <p>I'm trying to grasp the semantics of call/cc in Scheme, and the Wikipedia page on continuations shows the yin-yang puzzle as an example:</p>
  
  <pre><code>(let* ((yin
           ((lambda (cc) (display #\@) cc) (call-with-current-continuation (lambda (c) c))))
         (yang
           ((lambda (cc) (display #\*) cc) (call-with-current-continuation (lambda (c) c)))) )
      (yin yang))
  </code></pre>
  
  <p>It should output <code>@*@**@***@****@...</code>, 
  but I don't understand why; I'd expect it to output <code>@*@*********</code>...</p>
  
  <p>Can somebody explain in detail why the yin-yang puzzle works the way it works? </p>