This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-01-02
Channels
- # babashka (117)
- # babashka-sci-dev (6)
- # beginners (34)
- # biff (2)
- # calva (7)
- # clj-kondo (27)
- # clojure (6)
- # clojure-dev (8)
- # clojure-europe (41)
- # clojure-israel (1)
- # clojure-nl (1)
- # clojure-norway (2)
- # clojure-uk (1)
- # clojurescript (22)
- # cursive (3)
- # datascript (12)
- # dev-tooling (4)
- # emacs (13)
- # hyperfiddle (60)
- # introduce-yourself (8)
- # joyride (9)
- # lsp (46)
- # malli (3)
- # mranderson (75)
- # off-topic (40)
- # pathom (9)
- # pedestal (4)
- # reagent (11)
- # reitit (18)
- # releases (2)
- # shadow-cljs (81)
- # squint (18)
Hey all! Reader conditionals implementation leads to some surprising behaviors.
user=> (read-string {:read-cond :allow} "[^#?@(:clj [:b a c])]")
[^{:b true} a c]
user=> (read-string {:read-cond :allow} "[#_#?@(:clj [:b a c])]")
[a c]
(read-string {:read-cond :allow} "[# #?@(:clj [inst \"1978\" :etc])]")
[#inst "1978-01-01T00:00:00.000-00:00" :etc]
@baptiste-from-paris and I are tempted to treat them as undefined behaviors (and don’t replicate them in ClojureDart’s reader) as we can’t foresee any sensible usage for these.
Any advice?edamame
, that powers #CHY97NXE2, #C015LCR9MHD, #CLX41ASCS, etc can't parse any of these cases. it just throws
The first two kind of make sense to me, but not the third
@U064X3EF3 For the first point I don’t see the value in writing [^#?@(:clj [:b a c] :cljs [:x y z])]
instead of [#?@(:clj [^:b a c] :cljs [^:x y z])]
. Ditto for the second.
Agreed but it’s a tokenizing machine and it makes sense to me for that machine to do what the first two do
The last one effectively splits a token so that seems weird