Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make edn transmission resilient to symbols and keywords with more than one slash #588

Merged
merged 3 commits into from
Dec 7, 2023

Conversation

mk
Copy link
Member

@mk mk commented Dec 7, 2023

Symbols and keywords with more than one slash like foo/bar/baz can be read by read-string but not in ClojureScript which is based on tools.reader. This changes the roundtrippable? check to read using tools.reader to ensure a symbol will be tagged as a string in case it's not readable, fixing a read exception that could occur when reading in the browser.

This was especially problematic when using cider which overrides the printing of functions so they could be unreadable in the browser:

(pr-str (comp inc dec))
;; => "#function[clojure.core/comp/fn--5892]"

@mk mk merged commit 6dab22c into main Dec 7, 2023
8 checks passed
@mk mk deleted the tools-reader-readables branch December 7, 2023 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants