Skip to content
TurtleKitty edited this page May 11, 2019 · 2 revisions

gate

This operator delimits a user continuation. It does not affect the error continuation used by (guard ...) and (fail ...). gate, along with its partner capture, can be used to implement any control structure: coroutines, dynamic variables, backtracking, you name it.

(gate
   (+ 1
      (capture k (+ 1 (k (k (k 1))))))) ; 5

Clone this wiki locally