scittle

2025-07-09T12:45:14.552339Z

Would it be ok to add goog.string/format to Scittle (https://github.com/babashka/scittle/blob/main/src/scittle/core.cljs#L49)?

2025-07-09T12:45:32.020709Z

I can make issue + PR

borkdude 2025-07-09T12:50:32.372899Z

sure

borkdude 2025-07-09T12:50:37.155669Z

check how nbb does it

2025-07-09T12:50:52.185839Z

ok cool, will do

borkdude 2025-07-09T12:51:57.796019Z

hmm, spoke too soon, I thought I added it to nbb

borkdude 2025-07-09T12:52:23.302519Z

oh yes, there

borkdude 2025-07-09T12:53:05.681799Z

I guess it's fine to just add it to scittle.core

2025-07-09T12:54:37.359709Z

I think it has a slightly different function signature as clojure.core/format, but I will check. But if so that would be confusing maybe?

borkdude 2025-07-09T12:55:45.175029Z

I mean, to the configuration in scittle.core, I don't mean to add it to clojure.corre in scittle

2025-07-09T12:55:56.461819Z

ah ok, got it

2025-07-09T13:10:34.492229Z

Ok done. I tested it manually locally

2025-07-09T13:11:07.522469Z

oh wait, only for compile errors. Need to test functionality properly

2025-07-09T13:20:00.906269Z

ok all good

2025-07-09T13:31:47.556379Z

@borkdude you were right about the (goog.string.format "%05d" 123) . In Cljs that also works. But I don't remember seeing that being used before. Also I don't know if Sci supports this kind of namespace invocation?

borkdude 2025-07-09T13:33:24.653509Z

SCI does support namespace invocation, but let's just ignore it

2025-07-09T13:34:03.411689Z

Ok cool that Sci even supports it, but yeah think we can ignore it

2025-07-09T13:53:22.249939Z

I don't know if is a feature or a bug, but I just noticed that ordering in cljc constructs seems to matter When I do the following in Scittle:

#?(:scittle "scittle"
   :cljs "cljs") ;=> "scittle"
vs
#?(:cljs "cljs")
   :scittle "scittle")
    ;=> "cljs"
I guess I expected that :scittle would always be preferred instead. Not sure what the right behaviour is

borkdude 2025-07-09T14:14:01.935779Z

Ordering always matters in reader conditionals so it's a feature

❤️ 1
borkdude 2025-07-09T14:14:09.694989Z

Similar in bb

borkdude 2025-07-09T14:15:11.252389Z

you can even do this:

#?(:cljs (if #?(:scittle false: cljs true) ...)

2025-07-09T14:20:29.351809Z

Ah I'm a reader conditional noob 😄 good to know thanks!

borkdude 2025-07-09T14:26:19.595439Z

it's a common question :)

🙏 1