Yes, calls to <! and >! could be written with continuations, or call/cc, but they are not implemented that way. Instead the code inside the body of the `go` macro is rewritten into a statemachine. This sort of rewrite is a lot like the rewrites that C# does for yield, and Cython does much of the same sort of thing for Python generators.
This blog post goes into many of the details: http://hueypetersen.com/posts/2013/08/02/the-state-machines-of-core-async/ But the gist is this: 1) Chop up the code into blocks normally via a variant of Single Static Assignment compilation 2) Move all locals that need to exist across block transitions into a array, or a object field 3) Store the current state ID in a field. 4) To "pause" the machine, store the id of the next block and exit the function. Later on you can pick up again by grabbing the correct block id from the object field and then jumping back into that block. Timothy On Mon, Jul 10, 2017 at 2:41 PM, Răzvan Rotaru <razvan.rot...@gmail.com> wrote: > Hi, > > Pardon the ignorance, I was just rewatching Rich Hickeys talk about > core.async, and realized that the await call is actually a continuation > (like call/cc from scheme). And if I am not mistaken, you can't implement > call/cc with macros, so I suspect there is a difference, but I fail to see > it. Hence, my message here. > > Thanks, > Razvan > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- “One of the main causes of the fall of the Roman Empire was that–lacking zero–they had no way to indicate successful termination of their C programs.” (Robert Firth) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.