素数を求めてみた。

def calc_prime(from,to)
  result = []
  target = (from..to).to_a

  target.shift  if target.first <= 1 
  
  until target.empty?
    result << tmp = target.shift
    target.reject! {|x| x%tmp == 0}
  end
  result
end
p(calc_prime(1,1000)[81-1]) 
#=>419  #81番目の素数 419

Array#delete_if!は存在しないけど、Array#reject!は存在するみたい。

派閥争い?

rubyのEnumerableモジュールに含まれるメソッドには、ふたつの名前を持つものが存在する。
なんでも、smalltalk側とlisp側とで名前が異なっているらしい。*1

smalltalk collect detect select reject
lisp map find find_all delte_if

あなたはどっち派?*2
ちなみにいつもは|map|find|select|reject|という感じです。><

*1:勘違いしているかもしれません><

*2:これが言いたかった。(そのためだけに上のコードをry)