This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-09-01
Channels
- # adventofcode (2)
- # announcements (3)
- # babashka-sci-dev (79)
- # beginners (76)
- # biff (2)
- # calva (32)
- # cider (2)
- # clj-kondo (42)
- # clj-on-windows (17)
- # clojure (28)
- # clojure-belgium (1)
- # clojure-berlin (1)
- # clojure-europe (95)
- # clojure-nl (4)
- # clojure-norway (4)
- # clojure-uk (5)
- # clojurescript (27)
- # conjure (5)
- # cursive (3)
- # data-science (16)
- # datomic (67)
- # graalvm (12)
- # hyperfiddle (36)
- # jobs (3)
- # jobs-discuss (1)
- # kaocha (2)
- # klipse (1)
- # leiningen (28)
- # lsp (16)
- # luminus (3)
- # malli (10)
- # nrepl (3)
- # off-topic (57)
- # other-languages (18)
- # re-frame (4)
- # reitit (8)
- # releases (1)
- # remote-jobs (1)
- # scittle (4)
- # shadow-cljs (7)
- # test-check (1)
- # tools-deps (4)
- # vim (11)
- # xtdb (25)
does clojurescript have any equivalent to sayid's ability to trace all fns in a namespace? https://github.com/clojure-emacs/sayid
@U63D7UXJB you can also take a look at https://github.com/jpmonettas/flow-storm-debugger/ . Current stable version (2.3.141) doesn't support entire namespace tracing (you need to manually trace each fn) for ClojureScript, only for Clojure, but next 3.0 hopefully will when it is ready
BTW @U0739PUFQ I don't really have the time right now, but we probably should see if we can combine efforts since our tools do very similar things
yeah it would be great!
let me know if you have any ideas on how
Am I missing something here? In the spirit of printf debugging, I want to stringify the type of a value, but it was not trivial:
myapp.core> (type :foo)
cljs.core/Keyword
myapp.core> (str (type :foo))
"function (ns,name,fqn,_hash){\nthis.ns = ns;\nthis.name = name;\nthis.fqn = fqn;\nthis._hash = _hash;\nthis.cljs$lang$protocol_mask$partition0$ = 2153775105;\nthis.cljs$lang$protocol_mask$partition1$ = 4096;\n}"
myapp.core> (clojure.string/trim (with-out-str (cljs.pprint/pprint (type :foo))))
"cljs.core/Keyword"
The following is true for both Clojure and ClojureScript. Is that intentional? I'd expect the second a
argument to shadow the one destructured from a map.
(defn f [{:keys [a]} a] a)
(f {:a 1} 2) ;; 1
user=> (macroexpand-1 '(fn [{:keys [a]} a]))
(fn* ([p__138 a] (clojure.core/let [{:keys [a]} p__138])))
Is there a ticket or a discussion for this behaviour? I'm pretty sure it was discovered before many times
Also, while I'm not a language maintainer, I strongly suspect that this behavior will never be changed. Because such a change could break some already existing code.
that's true and super unfortunate
there was a discussion before and I think the conclusion was that clj-kondo could cover that? maybe it already does
The discussion wasn’t too long ago, and yes, I think it was a question as to whether clj-kondo should look for it. I was a bit surprised to see how it worked, but shouldn’t have been, given that destructuring is performed via macros.
Hi, just starting out and I'm unsure how to work with my filesystem. The options I've found are: • fs (nodejs package) • goog.fs I'm having a bit of a hard time understanding how to use goog.fs! I've used the Nodejs fs package and understand it but is it more typical to work with the goog libs?
From the docstring of goog.fs
:
> Wrappers for the HTML5 File API
So it's not what you need.
I use the promises API in the nodejs fs module, then one can use <p! or some more advanced cljs promise interop and feels more clojure-ey IMO, then also write little wrappers for the underlying fns basically applying (clj->js) to contain the raw javascript arguments
Personally, I’ve always liked the synchronous API on NodeJS.fs, because then I can make my Clojure and ClojureScript almost identical
i get you but all the guidance on node ever is never to block in prod, it probably doesn't matter a lot of the time but it feels very dirty
@U63D7UXJB Just so I'm going down the right path, is it the
fs/promises
library you are referring to? This is the one I typically use in JS