kernel/compiler/sexp.rb
##
# Replaces all elements whose node_type is +from+ with +to+. Used
# only for the most trivial of rewrites.
Replaces all elements whose node_type is +from+ with +to+. Used
only for the most trivial of rewrites.
Replaces all elements whose node_type is + from + with + to + . Used only for the most trivial of rewrites .
def find_and_replace_all(from, to)
    each_with_index do | elem, index |
      if Sexp === elem then
        elem.find_and_replace_all(from, to)
      else
        self[index] = to if elem == from
      end
    end
  end
def find_and_replace_all ( from , to ) each_with_index do | elem , index | if Sexp === elem then elem . find_and_replace_all ( from , to ) else self [ index ] = to if elem == from end end end
Replaces all elements whose node_type is +from+ with +to+.
Replaces all elements whose node_type is + from + with + to + .
from
to