   # Recursively traverses down the *children* of the nodes, yielding to a block
   # and returning true when the block finds a match. `contains` does not cross
   # scope boundaries.
-  contains: (block, arg) ->
+  contains: (pred) ->
     contains = no
-    @traverseChildren false, (node, arg) ->
-      if (rearg = block node, arg) is true then not contains = true else if arg? then rearg
-    , arg
+    @traverseChildren no, (node) ->
+      if pred node
+        contains = yes
+        return no
     contains
 
   # Is this node of a certain type, or does it contain the type?

  # Convenience for the most common use of contains. Does the node contain
  # a pure statement?
  containsPureStatement: ->
    @isPureStatement() or @contains (node, func) ->
      func(node) or if node instanceof While or node instanceof For
        (node) -> node instanceof Return
      else func
    , (node) -> node.isPureStatement()

  # `toString` representation of the node, for inspecting the parse tree.
  # This is what `coffee --nodes` prints out.


  isStatement: YES

  constructor: (body, head) ->
    if head.index instanceof Value
      throw SyntaxError 'index cannot be a pattern matching expression'
    extend this, head
    @body    = Expressions.wrap [body]
    @step  or= new Literal 1 unless @object
    @pattern = @name instanceof Value
    @returns = false
