rubinius/rubinius — pull request #1636 by txus (2012-03-26 05:38:09+00:00)
Title: Add #lazy_visit to Rubinius::AST::node

The #lazy_visit method accepts a visitor but it does not automatically iterate
over child nodes. From the method docs:

> Just like the #visit method does, #lazy_visit calls a method
> (determined by the #node_name method) on the visitor. It differs from
> #visit in the sense that it does not traverse the tree, leaving this
> up to the Visitor.
>
> This satisfies some Visitor pattern use cases in which the visitor
> needs to decide when (or whether) to iterate over a particular node's
> children, e.g. when implementing a source-to-source compiler.

Do you think this has its place in Rubinius::AST::Node, or is it too specific of a case? (Also, the naming could be better).