Skip to content

Instantly share code, notes, and snippets.

@rocketnia
Created March 22, 2015 09:14
Show Gist options
  • Select an option

  • Save rocketnia/f6585be411b652fa802c to your computer and use it in GitHub Desktop.

Select an option

Save rocketnia/f6585be411b652fa802c to your computer and use it in GitHub Desktop.
Tenerezza paradox with (swap-continuation ...)
; The problem with this isn't the paradox but the fact that the
; paradox is possible to create fully inside a single Tenerezza
; operation.
(swap-continuation original
; We could do the same thing as we do on the other side, but we do
; something simpler. We just send the back-and-forth continuation
; back to itself. This also demonstrates that we don't need
; `original` to be in scope here to produce the paradox (though it
; would be trivial to surround this whole thing with two more
; (swap-continuation ...) forms to get `original` in scope).
(swap-continuation back-and-forth (empty)
(swap-continuation ignored back-and-forth
back-and-forth))
(swap-continuation back-and-forth original
(union
; Send this back-and-forth to the original continuation. This
; makes it so we actually care what it contains.
back-and-forth
(swap-continuation original back-and-forth
; Send this back-and-forth everything it already has plus a
; wrapped-up version of itself. This goes infinite.
(union back-and-forth
(make foo /env-cons foo back-and-forth /env-nil))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment