Project

General

Profile

Actions

Feature #4234

closed

Hash#default_proc= Doesn't Accept nil Argument

Added by runpaint (Run Paint Run Run) almost 14 years ago. Updated over 12 years ago.

Status:
Closed
Target version:
-
[ruby-core:34108]

Description

=begin
The initial value of a Hash's default Proc is the block passed to Hash.new or nil. Hash#default_proc= can set the default Proc to a given Proc, but can't reset it to nil. This is unsymmetrical.

The attached patch lets #default_proc= take a nil argument, and provides tests. This causes a RubySpec failure ("Hash#default_proc= raises an error if passed stuff not convertible to procs"), which I will fix if this patch is applied.
=end


Files

hash-default-proc.patch (973 Bytes) hash-default-proc.patch runpaint (Run Paint Run Run), 01/06/2011 01:11 AM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0