This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-09-20
Channels
- # aleph (1)
- # announcements (1)
- # aws (11)
- # babashka (117)
- # beginners (34)
- # calva (13)
- # cider (3)
- # clj-commons (8)
- # clj-kondo (24)
- # clj-yaml (36)
- # cljsrn (46)
- # clojure (50)
- # clojure-australia (5)
- # clojure-europe (239)
- # clojure-nl (3)
- # clojure-norway (3)
- # clojure-spec (16)
- # clojurescript (25)
- # core-typed (20)
- # cursive (41)
- # datahike (1)
- # datalevin (1)
- # datomic (17)
- # fulcro (27)
- # hyperfiddle (35)
- # introduce-yourself (1)
- # jobs (4)
- # lsp (20)
- # malli (8)
- # meander (8)
- # nbb (1)
- # off-topic (31)
- # parinfer (9)
- # pathom (3)
- # portal (2)
- # re-frame (20)
- # react (2)
- # reagent (8)
- # releases (1)
- # remote-jobs (4)
- # scittle (2)
- # shadow-cljs (8)
- # slack-help (4)
- # sql (30)
- # squint (3)
- # tools-deps (34)
- # xtdb (21)
I think I'll dig into understanding the change in snakeyaml that caused '083'
to become 083
.
This might give me some notion of new ways to override the behaviour in clj-yaml (unlikely) or a write a PR to snakeyaml to undo it which might be considered by Andrey (possible).
I'll play around but I think the custom resolver technique will turn off recognizing octals.
I think grzm was mostly interested in what gets emitted (not what is parsed): quoted numbers should stay quoted. Is that what you're also referring to?
Doing this is still within the yaml 1.1 spec and will unbreak clojure users of clj-yaml
Thank you for considering me worthy of maintainer-hood. I respectfully decline. I’m moving to JSON to avoid the octal case, so that piece won’t be immediately bothering me; so the only other thing I’m looking for is some way to handle unknown tags. I’m interested in contributing to solutions for both of those, however: I just can’t add another ongoing commitment right now.
(and re: the passthrough/unknown-tags thing: I’m headed to StrangeLoop so will be out of this loop for the next week 😕)
(I mean, I'd hate to be like that awyeah-api maintainer: takes months to get to simple tickets and is behind the upstream aws-api library. Who does that?)
Thanks, @lee, @U04V15CAJ!
So I think I see what happened in snakeyaml. There was a bug that misinterpreted 083
as a float. And since a float is not a default scalar (string), it felt it needed to to quote it to preserve its string-ness by emitting it as '083'
. It now correctly interprets 083
as a string. And strings are not typically emitted with quotes. Soo… we get 083
output.
Odd thing, I was explaining the above to my wife, and she feigned disinterest. Imagine!
I’m not sure the custom Resolver approach will help here. 083
should still resolve to a string, we just want to emit that string wrapped in quotes.
I’m going to raise an issue at snakeyaml to propose that strings that look like numbers always be wrapped in quotes (and follow up with PR if Andrey is agreeable to the idea).
This already happens for certain strings like ones that start or end with a space.
@lee thanks! I think he is more keen to react to issues that already have a patch than to discuss with a lot of words and admit this needs a patch. my hunch
Yeah maybe. I’ll do my regular thing and raise the issue first with the offer of a PR. And maybe follow up with a PR before waiting for discussion.
Oh… yeah, I suppose, kinda backward for my brain. Issue helps me to think but could write that privately and blarp it all out at once.
Okey dokey, here’s my first stab at a PR: https://bitbucket.org/snakeyaml/snakeyaml/pull-requests/30/always-emit-numberish-strings-with-quotes