Core Class Changes: Array

Technical documentation
02/24/2008

General Overview

  • Removed the block form of any method where I felt that the block was nothing more than a way to avoid a call to Enumerable#map.

Specific Methods

Array#==
  • Fixed a bug where it was not honoring custom to_ary methods for RHS objects.
Array#[]
  • Specifying a negative length for the second form raises an ArgumentError.
Array#fetch
  • Removed. Useless method. Note that optparse.rb must then be modified.
Array#fill
  • No longer accepts a block.
  • Raises an ArgumentError if you provide a negative length.
  • Raises an IndexError if you specify a starting index greater than the length of the array.
  • Removed several redundant variables.
Array#indexes
  • Removed.
Array#indices
  • Removed.
Array#insert
  • Providing an index with no other arguments raises an ArgumentError.
Array#nitems
  • Removed unnecessary code.
Array#transpose
  • Removed. Marginal at best for the Array class. Generally only useful for Matrix and Vector, which implement it independently.
Array#zip
  • Custom implementation removed. Now just uses the mixed in Enumerable#zip method, which was itself altered. See "Core Class Changes: Enumerable" for more information.

Files