ztellman/riddley — pull request #15 by trptcolin (2014-06-23 05:54:35+00:00)
Title: Allow walking & not-walking the whole quote form

Input needed on this one.

Usually with `riddley.walk/walk-exprs`, I can assume I won't walk an expression unless my predicate allows it. I'm using a set, similar to what [proteus does](https://github.com/ztellman/proteus/blob/8c9be632670e319da0470cf6abe83ccfcbd56701/src/proteus.clj#L25-L30). But in the case of `quote`, I can't avoid walking expressions underneath it.

Originally I thought could just tack a `(predicate x)` onto the condition in [walk-exprs](https://github.com/ztellman/riddley/blob/fbf70b8013344ef2c45bd616b8bcfb412300a7c5/src/riddley/walk.clj#L204-L205) and add another condition that just returns its argument.

But there's more: if you want to be able to walk a `quote`d form, say to replace `quote` with `foobar`, it can't currently be done in master (as far as I can tell), and the naïve in the previous paragraph doesn't solve it. This patch does seem to solve it and pass the tests, *but* I'm pretty sure it breaks the idea of not macroexpanding inside a `quote` form. I'm actually having a bit of a hard time writing a test case showing that, but I think I can visualize why it's wrong. So I think sure this isn't really ready for prime time yet, but wanted to get it out there for input & brainstorming.