This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-11-05
Channels
- # aleph (2)
- # beginners (93)
- # boot (9)
- # cider (1)
- # cljs-dev (50)
- # cljsrn (4)
- # clojure (32)
- # clojure-russia (58)
- # clojure-spec (23)
- # clojurescript (146)
- # clojurewerkz (2)
- # component (1)
- # cursive (2)
- # hoplon (163)
- # off-topic (4)
- # om (117)
- # onyx (8)
- # pedestal (1)
- # re-frame (13)
- # reagent (34)
- # spacemacs (17)
- # test-check (1)
- # untangled (3)
I'm starting to look http://dev.clojure.org/jira/browse/CLJS-1622, but I'm starting to ask myself if the ticket makes sense
for the same reason of: http://dev.clojure.org/jira/browse/CLJS-1623
I'll add a comment in JIRA
this is a fun one: http://dev.clojure.org/jira/browse/CLJS-1830
(def a (sorted-map-by > 1 :a 2 :b))
(get a "a")
this fails because it ends up using the function version of <
, which returns false
for both (< "a" 1)
and (< 1 "a")
so the comparator returns 0
I'm not sure what the right fix is. Something that comes to mind is a runtime check that all the arguments passed to <
are numbers
@juhoteperi just attached a patch to http://dev.clojure.org/jira/browse/CLJS-1822 pretty diff here: https://github.com/anmonteiro/clojurescript/commit/e4ab8089321aca7ee576c0d8ab16aed85e7091ed
appreciate your feedback
@anmonteiro since 1.9.293
, I see that (my.ns$macros/xx)
evaluates to (my.ns/xx)
Is it on purpose?
https://github.com/clojure/clojurescript/commit/7e90ad51452ec5edd8ee7f2b7af9c7e7fb759c97
It causes me a problem with the port of core.match
there's probably a solution you're not seeing 🙂
definitely
can you point me to the specific line in the code?
As a temporary workaround I referred the cljs.core.match$macros
namespace explicitely https://github.com/viebel/core.match/blob/master/src/main/clojure/cljs/core/match.cljc#L81-L91
backtrack-expr
and backtrack-sym
are injected into the code
Therefore they are needed at run time
The clean solution would be to ensure cljs.core.match
is loaded when one requires the cljs.core.match$macros
and to define backtrack-expr
and backtrack-sym
inside cljs.core.match
Actually, I think this is the case already
in core.match README, the advised way to load core.match is
(ns foo.bar
(:require [cljs.core.match :refer-macros [match]]))
It cause both cljs.core.match
and cljs.core.match$macros
to be loaded
In my test code, I used
(ns my.match·
(:require-macros [cljs.core.match :refer [match]]))
So the bug is in my test code 🙂
@viebel it seems to me that you just need to (:require-macros [cljs.core.match])
in your :cljs
branch
I don't see you doing that anywhere?
in what file?
match.cljc
?
yeah..
it's the use case that 1.9.293 allows
but then all the functions defined inside the code will pollute cljs.core.match
namespace!
which functions?
all of them !!!
all of the functions defined in match.cljc
are needed by the macro namespace
sorry I don't understand what you're saying
I mean that for the purpose of macro expansion
there are a lot of functions defined
have you tried doing what I said?
those functions are not needed at “run-time"
What you said will probably work
My concern is: is it the proper solution?
so what is the problem? adding size to the build?
elegance
it is the proper solution for it to work in regular ClojureScript as well
ok let me try it
It works like a charm !