Skip to content

Extend reitit.walk keywordize to IPersistentVector - #796

Open
The-Alchemist wants to merge 1 commit into
metosin:masterfrom
The-Alchemist:walk-ipersistentvector
Open

Extend reitit.walk keywordize to IPersistentVector#796
The-Alchemist wants to merge 1 commit into
metosin:masterfrom
The-Alchemist:walk-ipersistentvector

Conversation

@The-Alchemist

@The-Alchemist The-Alchemist commented Sep 4, 2026

Copy link
Copy Markdown

Summary

  • reitit.walk extends IKeywordize to PersistentVector by exact class. subvec (APersistentVector$SubVector) and other IPersistentVector implementations therefore fall through to Object and are not walked, so keywordize-keys disagrees with clojure.walk.
  • Extend clojure.lang.IPersistentVector instead, matching the existing IPersistentMap fallback. PersistentVector behavior is unchanged.
  • Add a keywordize-subvec regression test (gen/any-equatable never produces subvecs).

Motivation

Cloffle is a Truffle/GraalVM implementation of Clojure. Its small vectors are PersistentTuple (IPersistentVector, not PersistentVector), so reitit.walk/keywordize-keys skipped nested maps inside (vector …) while clojure.walk did not. The same exact-class gap shows up on JVM Clojure with subvec. Extending IPersistentVector covers both.

Protocol extend is exact-class, so subvec (APersistentVector$SubVector)
and other IPersistentVector implementations skipped keywordize-keys and
disagreed with clojure.walk. Match the existing IPersistentMap fallback.

Signed-off-by: Karl Pietrzak <karl@medplum.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants