redplanetlabs / specter

Clojure(Script)'s missing piece
Apache License 2.0
2.51k stars 102 forks source link

recursive use of multi-path on cljs ignores 20th entry #318

Open stevebuik opened 2 years ago

stevebuik commented 2 years ago

following this example

https://github.com/redplanetlabs/specter/wiki/Using-Specter-Recursively#recursively-navigate-to-every-map-in-a-map-of-maps

but slightly more complex

(def MAP-NODES (recursive-path [] p (if-path map? (continue-then-stay (multi-path [MAP-VALS :a] [MAP-VALS :b] [MAP-VALS :c]) ; << different from example p))))

This works but...

On CLJS if there are 21 entries in the multi-path it fails to compile with an arity error. not on jvm.

Bug: On CLJS, if there are 20 entries, compiles ok but the 20th entry is not used. works fine on jvm.

Workaround: compose the multi-path out of other multi-paths so that the 20 limit is never reached