You are looking at historical revision 41781 of this page. It may differ significantly from its current revision.

quasiwalk

Quasiwalk is a tree-map that respects quote, quasiquote, and unquote. It's for metaprogramming.

(quasiwalk proc tree)

Applies proc to all the non-quoted atoms in tree. I mean, the tree itself cointains symbolic data, obviously (as in, one level of quotedness).

(quasiwalk (as-list reverse) '(this is '(an example)))
⇒ (siht si '(an example))

(quasiwalk (as-list reverse) '(this is `(another ,(example))))
⇒ (siht si `(another ,(elpmaxe)))

It can figure out nested levels of quasiquoting and unquoting.

The limitation in this version is that if quote, quasiquote, or unquote has been renamed in the environment, it doesn't know that. It works off of the original names (e.g. equality to those symbols exactly).

(quasiwalk* proc tree)

This variant runs quasiwalk for the side-effects but then doesn't return anything. It still does all the same consing as quasiwalk does, it's literally just (define (quasiwalk* proc tree) (quasiwalk proc tree) (void)) which is sometimes useful.

Source code

git clone https://idiomdrottning.org/quasiwalk