clojurescript

ClojureScript, a dialect of Clojure that compiles to JavaScript http://clojurescript.org | Currently at 1.10.879
william 2021-02-13T01:21:22.148200Z

is there something like https://github.com/clojure/data.generators/ for clojurescript?

william 2021-02-13T01:24:22.148700Z

in the sense of an explicitly seedable random generation library?

2021-02-13T02:52:53.149600Z

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.

2021-02-13T02:53:00.149800Z

Here's the issue, btw: https://clojure.atlassian.net/browse/CLJS-2351

2021-02-13T02:53:29.150200Z

Or at least subscribe so I can see when there are updates

2021-02-13T03:06:42.150300Z

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

2021-02-13T03:07:27.150600Z

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.

2021-02-13T03:09:07.150800Z

I don't know if http://ask.clojure.org lets you be notified on changes or new comments on one of its issues.

alexmiller 2021-02-13T03:53:12.151100Z

Ask does

alexmiller 2021-02-13T03:54:47.152Z

Most jiras should have a corresponding ask question

alexmiller 2021-02-13T03:55:16.152800Z

If it doesn’t, feel free to make one and reference it

2021-02-13T05:02:27.153Z

Thanks, I've registered and added an answer to the issue expanding the scope a little bit!

william 2021-02-13T14:48:49.154300Z

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 repl

william 2021-02-13T14:55:53.155300Z

I'm doing :dev {:compiler-options {:invalid-arithmetic false}} in shadow-cljs.edn but maybe that doesn't work for subdependencies?

2021-02-13T16:35:08.155400Z

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.

2021-02-13T16:36:03.155600Z

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.

william 2021-02-13T18:04:20.156Z

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}}}

Milan Munzar 2021-02-13T19:00:05.157500Z

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"))

2021-02-13T23:45:37.160800Z

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.

2021-02-13T23:54:42.161200Z

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.

2021-02-13T23:56:01.161400Z

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

👍 1
🙏 1
2021-02-13T23:59:42.161600Z

> … redefine the `for` macro in some way … That’s an excellent idea. I will try to redefine it as a fn in the env.