From: Intransition Date: 2012-05-12T05:14:10+09:00 Subject: Why do you think of NilClass#to_proc? ------=_Part_2007_7408199.1336767247583 Content-Type: multipart/alternative; boundary="----=_Part_2008_22661344.1336767247583" ------=_Part_2008_22661344.1336767247583 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit I have two minds about using a NilClass#to_proc class NilClass def to_proc Proc.new{ |*a| a } end end Or class NilClass def to_proc Proc.new{ nil } end end Which makes the most sense? I thought of the first b/c often default procedures are simply pass-thru procedures. On the other hand, is neither a good idea? Is any definition of NilClass#to_proc simply too "dangerous"? ------=_Part_2008_22661344.1336767247583 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit I have two minds about using a NilClass#to_proc

    class NilClass
      def to_proc
        Proc.new{ |*a| a }
      end
    end

Or

    class NilClass
      def to_proc
        Proc.new{ nil }
      end
    end

Which makes the most sense?

I thought of the first b/c often default procedures are simply pass-thru procedures.

On the other hand, is neither a good idea? Is any definition of NilClass#to_proc simply too "dangerous"?
------=_Part_2008_22661344.1336767247583-- ------=_Part_2007_7408199.1336767247583--