kernel/common/array.rb
# Removes and returns the first element in the
# Array or nil if empty. All other elements are
# moved down one index.
Removes and returns the first element in the
Array or nil if empty. All other elements are
moved down one index.
Removes and returns the first element in the Array or nil if empty . All other elements are moved down one index .
def shift()
    return nil if @total == 0
    obj = @tuple.at(@start)
    @tuple.put(@start,nil)
    @start += 1
    @total -= 1
    reallocate_shrink()
    obj
  end
def shift ( ) return nil if @total == 0 obj = @tuple . at ( @start ) @tuple . put ( @start , nil ) @start += 1 @total -= 1 reallocate_shrink ( ) obj end
Removes and returns the first element in the
Array or nil if empty.
Removes and returns the first element in the Array or nil if empty .