るりまサーチ

最速Rubyリファレンスマニュアル検索!
24件ヒット [1-24件を表示] (0.072秒)

別のキーワード

  1. _builtin drop_while
  2. _builtin drop
  3. socket ip_drop_membership
  4. socket ip_drop_source_membership
  5. array drop_while

ライブラリ

クラス

モジュール

検索結果

Enumerator::Lazy#drop_while {|item| ... } -> Enumerator::Lazy (18148.0)

Enumerable#drop_while と同じですが、配列ではなくEnumerator::Lazy を返します。

...Enumerable#drop_while と同じですが、配列ではなくEnumerator::Lazy を返します。

//emlist[例][ruby]{
1.step.lazy.drop_while { |i| i < 42 }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:drop_while>

1.step.lazy.drop_while { |i| i < 42 }.take(10).force
# => [42...
..., 43, 44, 45, 46, 47, 48, 49, 50, 51]
//}

@see Enumerable#drop_while...

Enumerable#lazy -> Enumerator::Lazy (37.0)

自身を lazy な Enumerator に変換したものを返します。

...返す) ように再定義されています。

* map/collect
* flat_map/collect_concat
* select/find_all
* reject
* grep
* take, take_while
* drop, drop_while
* zip (※一貫性のため、ブロックを渡さないケースのみlazy)
* cycle (※一貫性のため、ブロックを渡...
...ゴラス数を表示する
p pythagorean_triples.take(10).force # takeはlazyなので、forceが必要です
p pythagorean_triples.first(10) # firstはeagerです
# 100より小さいピタゴラス数を表示する
p pythagorean_triples.take_while { |*, z| z < 100 }.force
//}

@see Enumerat...