This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-03-04
Channels
- # admin-announcements (3)
- # alda (4)
- # beginners (30)
- # boot (116)
- # cbus (5)
- # cider (20)
- # clara (10)
- # cljs-dev (12)
- # cljsjs (41)
- # cljsrn (9)
- # clojars (6)
- # clojure (131)
- # clojure-bangladesh (5)
- # clojure-colombia (2)
- # clojure-dev (9)
- # clojure-ireland (4)
- # clojure-japan (3)
- # clojure-norway (10)
- # clojure-poland (6)
- # clojure-russia (59)
- # clojure-sg (1)
- # clojurebridge (2)
- # clojurescript (76)
- # clojurewerkz (4)
- # css (6)
- # cursive (21)
- # data-science (24)
- # datomic (27)
- # emacs (9)
- # hoplon (68)
- # jobs (2)
- # jobs-rus (1)
- # ldnclj (10)
- # lein-figwheel (9)
- # leiningen (21)
- # off-topic (5)
- # om (232)
- # onyx (63)
- # parinfer (2)
- # proton (25)
- # re-frame (12)
- # reagent (39)
- # untangled (6)
- # yada (122)
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: https://gist.github.com/mfikes/4e39c29c668e21f1bb71
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