This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-10-09
Channels
- # aleph (9)
- # bangalore-clj (1)
- # beginners (3)
- # boot (58)
- # cider (19)
- # cljs-dev (5)
- # cljsrn (31)
- # clojure (35)
- # clojure-greece (1)
- # clojure-poland (4)
- # clojure-russia (1)
- # clojure-spec (65)
- # clojure-uk (1)
- # clojurescript (41)
- # data-science (2)
- # datascript (6)
- # devcards (3)
- # emacs (2)
- # hoplon (10)
- # liberator (3)
- # numerical-computing (1)
- # off-topic (1)
- # om (18)
- # onyx (17)
- # parinfer (1)
- # planck (1)
- # re-frame (13)
- # specter (7)
- # uncomplicate (1)
- # untangled (4)
- # vim (1)
- # yada (2)
This is the output of a pr-str form. Invoking cljs.reader/read-string on it gives an error "Map literal must contain an even number of forms". Even feeding one directly into the other, (cljs.reader/read-string (pr-str @the-thing)) gives this error. I can't see what's causing the error:
{:client {:Wall Mart {:client-email "<mailto:[email protected]|[email protected]>"}, :k-Mart {:client-email "<mailto:[email protected]|[email protected]>"}}, :item {:123 {:item-name "wodget", :client "Wall Mart", :charge 10.5}, :789 {:client "k-Mart", :charge 20.45, :item-name "blaster"}, :456 {:item-name "wodget", :client "Wall Mart", :charge 10.5}}}
@nathansmutz :Wall Mart
<- there is a space in the keyword
Unfortunately prn can produce output that cannot be read
The problem is data inconsistency in model. Keys in :client
map should be strings, so you can easily access them from items without conversion to keyword
Woh, thanks @rarous. I didn't spot that. Now to figure out where "Wall Mart" got turned into a keyword.. and how my app didn't break because of it.
Ah, it was a workaround. I'm using the plato library to put that atom in persistent storage. It only supports keyword keys.
I've run into a strange issue: declaring a var :const
results in a warning "Can't redefine a constant ..." from the compiler. I'm pretty sure it isn't declared anywhere else (even tried giving it a random name). It's in a .cljc file. Maybe someone's met this before?
Also, it only seems to happen where the namespace which declares the constant is required by at least 2 other namespaces. This is probably a hint to those who are familiar with the compilation process.
@moxaj you probably want to defonce
that var
@anmonteiro works! but it's still a bug, isn't it?
@moxaj if you’re requiring the file twice, the def
is probably being evaluated twice.
but I can’t confirm that’s what’s actually happening
@anmonteiro probably, but still seems unintuitive to me
@anmonteiro defonce
solved my dummy case, but not the actual one. sad
@moxaj maybe an actual bug
if you can make a minimal repro, file a bug in ClojureScript’s JIRA
@anmonteiro will do
thanks!
There's a WeakMap polyfill in Google Closure Compiler - how does one use it? I understood you can inject polyfills using --inject_library=es6_runtime
when invoking the GCC explicitly but Clojurescript doesn't seem to support that. Should I just include the shim as a foreign library?
@moxaj It would be interesting to see what you get if you macroexpand
the quoted form of your defn
.
Perhaps try it with it off—perhaps there is a race in https://github.com/clojure/tools.reader/blob/3a0aaafbfdbc69b010e447a38e5ed628e0019068/src/main/clojure/clojure/tools/reader.clj#L631-L639
Nah, that’s OK it looks OK to me as well. I’d suggest turning off :parallel
to see if it goes away.
This is the option I meant to refer to :parallel-build
: http://clojurescript.org/reference/compiler-options#parallel-build
@mfikes also, if you scroll up a little, I had another issue where the compiler thought I was redefining constants - I tried with parallel-build off and it works
@moxaj Perhaps you’ve discovered two separate bugs related to :parallel-build
. If so, perhaps it will be possible to construct a minimal repro for a ticket.
@moxaj I’d personally lean towards holding off on creating a ticket until a minimal repro exists
But to answer your question, I don’t know what the rules are beyond what is documented here http://clojurescript.org/community/reporting-issues