clerk

Nguyen Hoai Nam 2024-10-29T05:34:06.946009Z

I think I found another issue with have a feature request for Clerk synced atoms: They currently can’t sync ##NaN. Today I tried to (reset! !state {:result ##NaN}) and got the following error message:

"Clerk can only sync values which can be round-tripped in EDN."
The cause is the use of = in viewer/edn-roundtrippable?. Edit: I forgot whether ##NaN is a valid edn literal. It’d still be nice to be able to sync ##NaN though.

2024-10-29T05:50:07.077839Z

##NaN is not valid edn, it is part of the edn superset that is clojure syntax

Nguyen Hoai Nam 2024-10-29T06:01:31.391789Z

You’re absolutely right. I should have checked the edn spec before reporting instead of assuming that all Clojure literals were valid edn literals. I’m not sure if this behavior is intuitive though.

2024-10-29T06:02:53.323639Z

Actually, looking at some prs on the spec, on the ticket where it was added to clojure Rich asks for the edn spec to be updated with it

Nguyen Hoai Nam 2024-10-29T06:09:23.558349Z

Technically the edn spec on GitHub doesn’t mention ##NaN, but (clojure.edn/read-string "##NaN") works just fine. I’m confused.