# File lib/ruby2ruby.rb, line 364
  def process_defn(exp)
    type1 = exp[1].first
    type2 = exp[2].first rescue nil

    if type1 == :args and [:ivar, :attrset].include? type2 then
      name = exp.shift
      case type2
      when :ivar then
        exp.clear
        return "attr_reader #{name.inspect}"
      when :attrset then
        exp.clear
        return "attr_writer :#{name.to_s[0..-2]}"
      else
        raise "Unknown defn type: #{exp.inspect}"
      end
    end

    case type1
    when :cfunc then
      s = "# method '#{exp.shift}' defined in a C function"
      exp.shift
      return s
    when :scope, :args then
      name = exp.shift
      args = process(exp.shift)
      args = "" if args == "()"
      body = indent(process(exp.shift))
      return "def #{name}#{args}\n#{body}\nend".gsub(/\n\s*\n+/, "\n")
    when :fcall then
      # skip the fcall (to define_method and such) and grab the body
      name = exp.shift
      exp.shift # :fcall to define_method
      body = process(exp.shift)
      raise "no"
    else
      raise "Unknown defn type: #{type1} for #{exp.inspect}"
    end
  end