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
form
using depth-first, post-order traversal, applyingf
to each form and replacingform
with 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
form
as bypostwalk
, replacing elements appearing as keys in the mapreplacements
with the corresponding values.
- fn (prewalk f form)[source]¶
Walk
form
using depth-first, pre-order traversal, applyingf
to each form and replacingform
with 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
form
as byprewalk
, replacing elements appearing as keys in the mapreplacements
with the corresponding values.