basilisp.walk¶
Generic data structure walkers.
Support for all builtin data structures and types is included by default. Users
can add support for custom data types by extending the IWalkable protocol.
- fn (keywordize-keys form)[source]¶
Recursively walk
form, transforming string keys into keywords in any maps.
- fn (postwalk f form)[source]¶
Walk
formusing depth-first, post-order traversal, applyingfto each form and replacingformwith its result.All built in data structures are supported.
Lazy sequences will be completely consumed (and thus may not be infinite).
- fn (postwalk-replace replacements form)[source]¶
Recursively walk through
formas bypostwalk, replacing elements appearing as keys in the mapreplacementswith the corresponding values.
- fn (prewalk f form)[source]¶
Walk
formusing depth-first, pre-order traversal, applyingfto each form and replacingformwith its result.All built in data structures are supported.
Lazy sequences will be completely consumed (and thus may not be infinite).
- fn (prewalk-replace replacements form)[source]¶
Recursively walk through
formas byprewalk, replacing elements appearing as keys in the mapreplacementswith the corresponding values.