okay, thank you very much!
Pretty useful, thank you!
Is there a simple way to print floats with comma separation with (cl-format nil "???" 1234.56111) => "1,234.56"
?
Thanks! I just used i18n directly and it worked OK
Youβre welcome!!
user=> (cl-format nil "~:d" 1234)
"1,234"
cl-format can do a lot, the trick is to google for "common lisp format"it's a full turing complete dsl actually
That works for integers, but I didn't see anything for floating point numbers.
which surprised me, given that it can encode integers as Roman numerals π
that is, I didn't see any short built-in format specifier for putting comma-separators in the integer part of a floating point number when printed -- I didn't try to delve into the Turing-complete part of cl-format.
yeah, I caught that after pasting my example, it's clearly more complicated to do the commas plus the truncation...
Or another way to achieve the same thing? I can't find something in goog.string that does it either
I don't see a way that cl-format can do this. I don't know the Google Closure library well enough to say whether it can, but it seems pretty extensive.
Or just use goog.i18n
Hi, I have a question about using Serveress function related to using a db connection. It's not strictly related to Clojure but I'm using Clojure in this case. In general, when you have a server, a key thing to configure is a connection pool so that you can reuse an existing connection instead of creating a new one every time. How should I handle this when working with a serveless function?
This heavily depends on the serverless platform you use
Some platforms keep instances 'warm' .. so if you get enough requests, a connection to the database is still alive.
You probably want a single connection though - not a pool. Since a serverless function is usually 'one thread'.
Well, depends on the platform again
I understand how to update nested maps using assoc-in
but how do I add an element to an array in a nested structure when I don't know the length?
@meditans update-in
with conj
is probably what you want.
thanks @seancorfield!
Does anyone have experience with integrating something like Sentry in a project? Or an alternative to catch and record exceptions?