This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-09-13
Channels
- # aws-lambda (21)
- # beginners (8)
- # boot (67)
- # braveandtrue (2)
- # cider (12)
- # cljs-dev (38)
- # cljsjs (87)
- # cljsrn (11)
- # clojure (307)
- # clojure-austin (29)
- # clojure-finland (1)
- # clojure-italy (9)
- # clojure-russia (19)
- # clojure-spec (71)
- # clojure-uk (33)
- # clojurescript (109)
- # clojutre (1)
- # core-async (2)
- # cursive (24)
- # datomic (11)
- # devops (5)
- # ethereum (5)
- # figwheel (2)
- # hoplon (25)
- # ipfs (1)
- # jobs (1)
- # luminus (17)
- # off-topic (2)
- # om (38)
- # om-next (3)
- # onyx (166)
- # other-lisps (1)
- # proton (5)
- # re-frame (15)
- # reagent (45)
- # ring (2)
- # spacemacs (6)
- # specter (12)
- # untangled (58)
- # yada (23)
one situation where implicit macro loading doesn’t work:
you have foo.bar
namespace which declares macros and in bar.cljs
you don’t require-macros
from itself
in foo.other
you require foo.bar :refer [a macro]
throws saying a macro
doesn’t exist
but if you refer-macros [a macro]
everything works fine
@dnolen I’m trying to understand if this is by design or should maybe be the focus of future work in implicit macro loading
it could possibly (can’t know without trying) solve the problem of using require-macros
in an own namespace for bootstrap CLJS, which currently throws max call stack exceeded
@juhoteperi hrm, will take a look later
@anmonteiro you need to make the explicit link between a macro ns and the runtime ns of the same name
@dnolen I’m trying to understand why that is. is there a JIRA design page or issue that discusses this? I can maybe see one reason which is undesired side effects if you don’t make the explicit link
e.g. if you don’t want to require-macros
by default there would be no way to express that. probably a good enough reason
@anmonteiro making a link based on the name is never going to be safe
yeah, sounds like a good enough reason to me
yesterday I was playing with #js
values and it seems like strings are emitted into javascript as they are without escaping backslashes, it manifested this way: I would expect #js {“key\\x” 0}
to product js object with key ‘key\x’ (single backslash), but instead it gives me ‘keyx’, I have to double backslash it #js {“key\\\\x” 0}
, so java string is ‘key\\’ and when emitted to js, it gets again interpreted as a backslash and produces object with key ‘key\x'
@darwin have you tried it in any other engine than V8?
https://github.com/clojure/clojurescript/blob/master/src/test/cljs/cljs/core_test.cljs#L558
sounds related?
that V8 fail can be related, if you escape something which makes no sense to be escaped, some js engine could complain and other just silently use unescaped version (I can imagine)
if you can demonstrate this somehow different from how we emit strings in general - then something to look at
I might investigate it further, because now I feel quite insecure, emitting strings from macros into cljs code in general if they have the same issue
e.g. I have a string loaded from outside, I want to emit it as-is via a macro, and if it happens to include backslashes I will end up with a different string in JS (cljs)