This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-09-21
Channels
- # announcements (51)
- # asami (5)
- # babashka (25)
- # babashka-sci-dev (26)
- # beginners (33)
- # calva (10)
- # clj-kondo (51)
- # clj-yaml (99)
- # clojure (96)
- # clojure-australia (3)
- # clojure-berlin (5)
- # clojure-europe (151)
- # clojure-norway (58)
- # clojurescript (20)
- # cursive (13)
- # datalevin (1)
- # datomic (19)
- # docker (6)
- # emacs (55)
- # events (1)
- # fulcro (50)
- # gratitude (8)
- # juxt (7)
- # leiningen (5)
- # malli (6)
- # membrane (1)
- # nbb (28)
- # off-topic (22)
- # pathom (7)
- # polylith (20)
- # portal (1)
- # reagent (37)
- # reitit (2)
- # releases (2)
- # reveal (32)
- # scittle (34)
- # shadow-cljs (46)
- # testing (10)
- # tools-deps (33)
- # xtdb (18)
Clormat 0.0.1
A clean reimplementation of clojure.core/format
for Clojure/ClojureScript
Repo: https://github.com/quoll/clormat
This covers some of the basic functionality of the format
function, specifically for ClojureScript. It's an initial release, covering positional parameters, along with several of the datatypes and flags. Significantly, it is still missing floating point formats and date/times, but these are in progress.
The function aims for clojure.core/format
compatibility wherever possible.


Like, what should this return?
(format “%,(010d” -101)
I thought maybe ”(000,101)”
because it can't be ”(,000,101)”
but it turns out that prefixing zeros don't get grouped, even though the NumberFormat classes on both Java and JavaScript DO group prefixing zerosmatching behavior like this is so hard. thanks for doing it 💜
Or… how should -1 be represented in hex? It can't be 64 bits wide because integers on JavaScript are only 52 bits wide
oh god I didn't even think of that
how do you mean?
For instance, ”%-010d”
says to print a number at least 10 characters wide, left-justified, with leading zeros to make up the width. But if it's left-justified then there can't be any leading zeros
If there are leading zeros then it will take up the whole width and left/right justification won't matter
this just in: found the text formatting goddess
I get paralyzed with those kinds of choices tbh
and in the end devs need to be aware of at least some of it
Programming in a nutshell: You are walking down the street only to fall in a little pothole that ends up being 3km deep and require a thorough study of spelunking to get out again.
> An implementation of the cljs.core/format
function for ClojureScript. Also runs (redundantly) in Clojure.
Not sure how I should read this. Should it say an implementation of the clojure.core/format
function?
Are you trying to do this without reading the openjdk source?
The name was probably informed by the existence of cl-format, but I was just thinking “CLojure fORMAT”
That’s cool and a much harder task lol. Makes sense for licensing reasons if you want to upstream it; you’re a champ for doing this
Yes… very finicky. I’ve been exploring more, and I now have more info to make it better for localization (correcting expanding with zeros, etc)
Is it supposed to format numbers and things according to locale? If so I could have a look at the Swedish.
It’s defined to work against the current default locale, which I have yet to figure out how to set during testing 🙂
There are relatively consistent rules to follow regardless of locale, but not all of it is apparent
Expand with 0s varies according to the number system in use (see the earlier message). Group separators are an issue as well, since they also vary with the numbering system
The second character is the group separator. European countries are easy enough for me: UK: “1,234”, FR: “1 234", GE: “1.234”
Although the Dutch uses comma for decimals, and dot for thousands. Exactly opposite of Americans. This has never lead to input confusion for me-as-a-Dutchie
Here are all the possible outcome for (format "%,d" 1234)
:
"1,234"
"1.234"
"1234"
"1 234"
"1’234"
"١٬٢٣٤"
"۱٬۲۳۴"
"१,२३४"
"১,২৩৪"
"๑,๒๓๔"
"༡,༢༣༤"
"၁,၂၃၄"
Extra notes:
• clojure.core/format
wraps java.lang.String/format
which does not accept a locale. This means that it always select the current default, and you cannot control it on this function.
• You can control it on the JVM, via: (String/format (Locale/forLanguageTag "sv") "%,d" (object-array [1234]))
• You can do the same on JS via: (.format (js/Intl.NumberFormat. "sv" #js{:grouping: true}) 1234)
• This is for the trivial case of a pattern of "%,d"
. More detailed cases cannot be formatted via the locale settings, and require manual intervention. For instance, when using "%,010d"
then using locale formatting to ask for 10 digits in the UK will give an output of: "0,000,001,234"
. However, the format
function actually outputs: "000001,234"
. Note how the localization groups the zeros, but the format
does not?
clj-paginate 0.2.52
Fast pagination of vectors and maps with Clojure for GraphQL. Easily handles vectors with 10M entries.
Repo: https://github.com/ivarref/clj-paginate
This release adds support for :sort-fn
and with that custom ordering (ascending/descending) of attributes.
https://github.com/ivarref/clj-paginate#descending-values-example.
It's backwards compatible with the previous release.

[ANN] FlowStorm Clojure[Script] debugger 3.0 is out FlowStorm is a Clojure and ClojureScript debugger with some unique features. Version 3.0 has been redesigned to be much simpler and more extensible. It goes from being a debugger to being a platform for building debuggers + a reference implementation. Most remarkable new features for this version are : • ClojureScript is feature par with Clojure now, so every feature is available to both languages. • Remote debugging can be accomplished by just connecting to a nrepl server (socket repl support on the roadmap) • A programmable API. This means debug your code by writing Clojure code that uses the debugger infrastructure. See (https://jpmonettas.github.io/flow-storm-debugger/user_guide.html#_programmable_debugging) • Opens the possibility for future integration with IDEs/editors Github repo : https://github.com/jpmonettas/flow-storm-debugger/ User Guide https://jpmonettas.github.io/flow-storm-debugger/user_guide.html Big thanks to Roam Research (https://roamresearch.com/) for sponsoring the project! If you have any questions please show up on #flow-storm in clojurians slack PD : I'm planning to make some videos on how to use FlowStorm to debug different kinds of applications (web apis, re-frame SPAs, etc) I hope you find it useful. Cheers!



👏 👏 👏 Been waiting for this thank you so much! 🙏
you are welcome! if you have any questions show up in #flow-storm!
for people that tried it for ClojureScript and was annoyed by having to reconnect the debugger by hand when reloading a browser page or restarting the shadow repl just released 3.0.188
which does automatic connection management. It also shows the connection status for the repl and the runtime on the bottom right corner