kernel/common/array.rb
# Removes all elements from self that are #== to the given object.
# If the object does not appear at all, nil is returned unless a
# block is provided in which case the value of running it is
# returned instead.
Removes all elements from self that are #== to the given object.
If the object does not appear at all, nil is returned unless a
block is provided in which case the value of running it is
returned instead.
Removes all elements from self that are # == to the given object . If the object does not appear at all nil is returned unless a block is provided in which case the value of running it is returned instead .
def delete(obj)
    key = Undefined
    i = @start
    tot = @start + @total
    while(i < tot)
      if(@tuple.at(i) == obj)
        @tuple.put(i, key)
      end
      i+=1
    end
    if((deleted = @tuple.delete(@start,@total,key)) > 0)
      @total -= deleted
      reallocate_shrink()
      return obj
    else
      if block_given?
        yield
      else
        nil
      end
    end
  end
def delete ( obj ) key = Undefined i = @start tot = @start + @total while ( i < tot ) if ( @tuple . at ( i ) == obj ) @tuple . put ( i , key ) end i += 1 end if ( ( deleted = @tuple . delete ( @start , @total , key ) ) > 0 ) @total -= deleted reallocate_shrink ( ) return obj else if block_given? yield else nil end end end
Removes all elements from self that are #== to the given object.
Removes all elements from self that are # == to the given object .
obj
<not_specific>