
class NilClass

  # Allows <tt>nil</tt> to respond to #[].
  # Always returns nil.
  #
  #  nil[]   #=> nil
  #
  def [](*args)
    nil
  end

end



#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#
=begin test

  require 'test/unit'

  class TCNilClass < Test::Unit::TestCase

    def test_op_fetch
      assert_equal( nil, nil[] )
      assert_equal( nil, nil[1] )
      assert_equal( nil, nil[1,2,3] )
    end

  end

=end
