On Monday, July 21, 2014 at 12:28 PM, Daniel Kersten wrote: > You must use <! and >! from within go directly - you cannot use them inside a > function or macro. > > This is because the go macro walks the abstract syntax tree to turn it into a > state machine and as it does this, it turns the calls to <! and >! into > something else (in fact, if you look at the source, you will see that <! and > >! themselves
To me, this limitation ends up as a an important hole in the otherwise compelling story of Clojure extensibility via macros in general and of core.async in particular. It feels like the (important) go construct in core.async is plugged into Clojure as a macro because that is the only plug point available that is somewhere near its needs. But to be more complete, core.async go would need to fit in a different kind of plug point. It would act as something like a macro that plugs in after parsing of an entire file (or an entire program?), after other macros, before the next step of compilation. Now this sounds perhaps close to a “reader macro” which can make arbitrary changes to the language even up the syntax level; but from my (very shallow relative to the gurus) understanding, I think that is not really the case. I think such a plug point would be still in keeping with the notion that Clojure code always looks like Clojure code and generally does approximately what it looks like modulo some limited modification via macros. Of course it is easy to sit here in comfort and describe a deep, complex, and important change someone else could make. :-) -- Kyle Cordes http://kylecordes.com -- Note that posts from new members are moderated - please be patient with your first post. --- You received this message because you are subscribed to the Google Groups "ClojureScript" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/clojurescript.
