Fork me on GitHub

Evidently, there is no need to build macro towers in bootstrap. If this is true, it would be huge for the desired consistency between bootstrap and JVM ClojureScript. In short, it means that a macro can call a macro in the same namespace (we can relax the staging rules). I know empirically that it works with Planck and with Replumb (via Elbow). I think the underlying technical reason it works is perhaps related to the fact that (cljs.core$macros/inc 3) happens to work as a macro invocation. I don’t want to actually claim that we can relax the rules, but here is the gist that works:


By the way, I suspect we couldn’t see this until relatively recently (mid-Jan), owing to it needing syntax-quote working.


Actually, looking into the above a little more, it is abiding the staging rules, owing to the way macroexpansion works. If you instead have either a function that calls a macro, or a macro that calls a macro during expansion as opposed to expanding to a macro call, then you violate the staging rules. TL;DR: The above is valid, plays by the rules, and it doesn’t imply any rules can be relaxed.


@mfikes for CLJS-1587 #{1 '1} translates the items to (1 (quote 1)) in clojure and (1 1) for ClojureScript.


So the checks for distinctness (= (count (into #{} items)) (count items)))passes in Clojure. Is there a good way to flatten out (quote x) from a seq?


can't you use distinct? sorry don't know the problem at end, just suggesting 😄


Nope the sequence is (list 1 (list 'quote 1)) when distinctness is tested but gets turned into (list 1 1) when getting turned into JavaScript


oh now is clear yes


I don't know how to help you with that, and filtering the quote forms seems a bad workaround


@spinningtopsofdoom There is a bit of discussion going on in #C06E3HYPR on literals and duplicate checks


It can be fixed by adding (-> item :env :quoted? not) to the (= (:op item) :constant) check that happens for the on the item's ast


so that any quoted item uses fromArray instead of building a literal PersistentArrayMap with duplicate keys