41件ヒット
[1-41件を表示]
(0.020秒)
種類
- インスタンスメソッド (20)
- クラス (11)
- 文書 (10)
ライブラリ
- ビルトイン (31)
クラス
-
Enumerator
:: Lazy (20)
キーワード
- Lazy (11)
-
NEWS for Ruby 2
. 2 . 0 (10)
検索結果
先頭4件
-
Enumerator
:: Lazy # slice _ after {|elt| bool } -> Enumerator :: Lazy (21272.0) -
Enumerable#slice_after と同じですが、配列ではなく Enumerator::Lazy を返します。
...Enumerable#slice_after と同じですが、配列ではなく Enumerator::Lazy を返します。
//emlist[例][ruby]{
1.step.lazy.slice_after { |e| e % 3 == 0 }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x007fd73980e6f8>:each>>
1.step.lazy.slice_after { |e| e % 3 == 0 }.tak......e(5).force
# => [[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12], [13, 14, 15]]
//}
@see Enumerable#slice_after... -
Enumerator
:: Lazy # slice _ after(pattern) -> Enumerator :: Lazy (21272.0) -
Enumerable#slice_after と同じですが、配列ではなく Enumerator::Lazy を返します。
...Enumerable#slice_after と同じですが、配列ではなく Enumerator::Lazy を返します。
//emlist[例][ruby]{
1.step.lazy.slice_after { |e| e % 3 == 0 }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x007fd73980e6f8>:each>>
1.step.lazy.slice_after { |e| e % 3 == 0 }.tak......e(5).force
# => [[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12], [13, 14, 15]]
//}
@see Enumerable#slice_after... -
Enumerator
:: Lazy (6054.0) -
map や select などのメソッドの遅延評価版を提供するためのクラス。
...hile
* slice_before, slice_after, slice_when
* chunk
* zip (※互換性のため、ブロックを渡さないケースのみlazy)
Lazyオブジェクトは、Enumerable#lazyメソッドによって生成されます。
Lazyから値を取り出すには、Enumerator::Lazy#force または
Enum......て偶数になるような整数を、小さい方から5個表示する
p 1.step.lazy.select{|n| (n**2).even?}.first(5)
# LTSV (http://ltsv.org/) 形式のログファイルから検索を行う
# Enumerator::Lazy#map は配列ではなく Enumerator を返すため、
# 巨大な配列を確保......しようとしてメモリを使い切ったりはしない
open("log.txt"){|f|
f.each_line.lazy.map{|line|
Hash[line.split(/\t/).map{|s| s.split(/:/, 2)}]
}.select{|hash|
hash["req"] =~ /GET/ && hash["status"] == "200"
}.each{|hash|
p hash
}
}
//}......ice_before, slice_after, slice_when
* chunk, chunk_while
* uniq
* zip (※互換性のため、ブロックを渡さないケースのみlazy)
Lazyオブジェクトは、Enumerable#lazyメソッドによって生成されます。
Lazyから値を取り出すには、Enumerator::Lazy#force ま......fore, slice_after, slice_when
* chunk, chunk_while
* uniq
* compact
* zip (※互換性のため、ブロックを渡さないケースのみlazy)
Lazyオブジェクトは、Enumerable#lazyメソッドによって生成されます。
Lazyから値を取り出すには、Enumerator::Lazy#forc... -
NEWS for Ruby 2
. 2 . 0 (12.0) -
NEWS for Ruby 2.2.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...* 追加: Binding#local_variables
* 追加: Binding#receiver
* Dir
* 追加: Dir#fileno
* Enumerable
* 追加: Enumerable#slice_after
* 追加: Enumerable#slice_when
* 拡張: Enumerable#min, Enumerable#min_by, Enumerable#max, Enumerable#max_by
は複数の値を......した。9634
* メジャーGCにインクリメンタルマーキングを導入しました。10137
* malloc によって起きた GC で lazy sweep を有効にしました。
* VM
* Hash#[] と Hash#[]= で変更不可能な文字列リテラルを使用するようにしまし...