-
-
Save charles-dyfis-net/2235a2fa03ecd57b0a7c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn walk-soda-obj [obj] | |
"For each object in the given parse tree, yield: | |
[key object parent & [list list-idx]]" | |
(let [obj-bean (soda-bean obj)] | |
(concat | |
(for [[prop-key child-list] (.getMutableLists obj-bean) | |
[child-idx child] (map-indexed vector child-list)] | |
(concat | |
[[prop-key child obj child-list child-idx]] | |
(walk-soda-obj child))) | |
(for [[prop-key child] (.getItemMap obj-bean) | |
:when child] | |
(concat | |
[[prop-key child obj]] | |
(walk-soda-obj child)))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Intended output is a single sequence of vectors. Actual output is a sequence of sequences of vectors