how widespread is the usage of the transit-python package?
FWIW I use it.
that's widespread enough, thanks 🙂
hey folks, is there an all
construct in clojure? For determing whether all entries in a list are true?
or anything similar?
@nickt (every? true? list-of-bools)
?
ah! Yes, thank you
Hello, does anybody know decent library to create UI in clojure? quick google got me fn-fx, is it good enough? I really want to use clojure for my school assignment, but i don't want to risk to try something buggy.
https://github.com/cljfx/cljfx see also #cljfx
You might want to check out cljfx and the #cljfx channel
Thank you!
Addition to @markbastian, if you want React like virtual dom functionality you could check fork of seesaw (I wrote); https://github.com/ertugrulcetin/seesaw
can I log readable data with clojure.tools.logging like I can with pedestal.log ?
ah, logging.readable
when a macro definition calls a fn
, are the arguments evaluated?
Depends on how you escape-quote
right, so, if it’s inside a syntax quoted section (i.e. backtick), then it ends up as part of the expansion (not evaluated), so it seems fairly obvious that in that case the fn
is not even called at definition time, right?
Correct. Only unquoted (~) forms are evaluated at macroexpansion time. Now when we get into nested quoting/unquoting… :)
not only unquoted, but also forms appearing before the first backtick, right?
like if you have something along these lines:
(defmacro something [& rest]
(let [foo (my-fn (first rest))]
...
then my-fn
is invoked with the first item from the macro arg list, which is an unevaluated symbol, I believe
so the real question is, does my-fn
receive it as an unevaluated symbol as well? or does it evaluate?
It can't evaluate, that code happens at macroexpansion time, my-fn receives unevaluated form or symbol or literal, whatever was passed in.
thank you! when you put it that way, it makes perfect sense
@jeffrey.wayne.evans “not only unquoted, but also forms appearing before the first backtick” Absolutely, and a fun homoiconic trick is to add debug print statements in such code to see what is going on, especially with more elaborate/destructured macro params. Nice learning aid as I was getting up to speed on macrology.
yeah I have definitely made use of that. glad to hear there isn’t an obvious better way to debug macros 😂
as in, errors even during macroexpand
Is there an idiomatic way to get the time of how long my program has been active/running?
(time ...) macro for small parts ?flame-graphs? for larger parts? (I havent used flame-graphs myself)
I've used seesaw for a school assignment. cljfx is the way to go for "real" or "good" apps, but seesaw has a better chance of running on a random JVM
Yes! in fact, I know this for some insane reasons
https://docs.oracle.com/javase/7/docs/api/java/lang/management/RuntimeMXBean.html
it is in RuntimeMXBean
(-> (ManagementFactory/getRuntimeMXBean)
(.getUptime)
(Duration/ofMillis))
and before you ask I have no clue what an MXBean is
Thanks I’ll mess around with this. This looks like what I was trying to achieve, the uptime of the current runtime!
Yeah the "idiomatic" part is just dealing with Duration objects instead of the long for any logic