is there something like https://github.com/clojure/data.generators/ for clojurescript?
in the sense of an explicitly seedable random generation library?
There's an issue in CLJS that I'd like to signal my interest in, what's the best way to do that? I didn't see a way to register.
Here's the issue, btw: https://clojure.atlassian.net/browse/CLJS-2351
Or at least subscribe so I can see when there are updates
Here, perhaps? Assuming I haven't messed up and got the wrong issue: https://ask.clojure.org/index.php/6265/setting-arglists-metadata-when-vararg-is-present?show=6457#a6457
I know CLJ issue votes are examined there. I don't know whether ClojureScript devs look at them on http://ask.clojure.org or not.
I don't know if http://ask.clojure.org lets you be notified on changes or new comments on one of its issues.
Ask does
Most jiras should have a corresponding ask question
If it doesn’t, feel free to make one and reference it
Thanks, I've registered and added an answer to the issue expanding the scope a little bit!
can I disable warnings from libreries I'm importing? I'm using loom
in cljs, and there's always this warning:
------ WARNING #1 - :invalid-arithmetic ----------------------------------------
Resource: loom/alg_generic.cljc:494:19
cljs.core/bit-or, all arguments must be numbers, got [any Long] instead
--------------------------------------------------------------------------------
there's a patch at https://github.com/aysylu/loom/pull/125 but it hasn't been merged. I'd like to not see that warning when I use my replI'm doing :dev {:compiler-options {:invalid-arithmetic false}}
in shadow-cljs.edn
but maybe that doesn't work for subdependencies?
A general technique for making arbitrary changes to a library is to create your own fork, make whatever changes you want, and use that, perhaps publishing the result in a way that not only you but others could also use. That happens semi-often, and can lead to confusion for new users of the library which one to use, but it is very effective.
I don't know any ways to disable warnings for a single library. There may be hacks like filtering the output through some code that recognizes and removes the warnings you don't want to see, but that seems fragile and kludgy.
thanks @andy.fingerhut, I'm still learning to use shadow, and so wasn't sure on how I could include a local fork from there. I also now know that this option fixes what I wanted in shadow
:
:dev {:compiler-options {:warnings {:invalid-arithmetic false}}}
Hey, 🙂 Do you know how to make a type based dispatch in ClojureScript. I.e. shorter version of:
(defmulti foo (fn [x]
(cond
(fn? x) :function
(seq x) :sequence
:else :unsupported)))
(defmethod foo :function [_] (println "function"))
(defmethod foo :sequence [_] (println "sequence"))
Using cljs.analyzer.api/analyze-file
, is there a way parse the source code without having the macro clojure.core/for
expanded?
My goal is to analyze the body of the for
, and the macro expansion is making it very very difficult to find the body in the general case.
wild guess, which I've never tried and there might be very good reasons that it would not work -- redefine the for
macro in some way that it will only affect your analyze-file
call, so that the expansion of for
is something easy for you to recognize, and leaves the input expression pretty much unchanged? e.g. you could expand it to something like (do :my-custom-magic-keyword-to-recognize-for-expansions ...)
where the ...
contains something where all of the original for
subexpressions are there.
Maybe the ...
could be a (let <for-bindings> <for-body-exprs>)
so it would be more likely to be correct and not give errors of unknown symbols in the for body
> … redefine the `for` macro in some way … That’s an excellent idea. I will try to redefine it as a fn in the env.