kernel/bootstrap/array.rb
# Creates a new Array from the return values of passing
# each element in self to the supplied block.
Creates a new Array from the return values of passing
each element in self to the supplied block.
Creates a new Array from the return values of passing each element in self to the supplied block .
def map
    return dup unless block_given?
    out = Array.new @total
    i = 0
    while i < @total
      out[i] = yield(at(i))
      i += 1
    end
    out
  end
def map return dup unless block_given? out = Array . new @total i = 0 while i < @total out [ i ] = yield ( at ( i ) ) i += 1 end out end
Creates a new Array from the return values of passing
each element in self to the supplied block.
Creates a new Array from the return values of passing each element in self to the supplied block .