種類
- インスタンスメソッド (77)
- 文書 (17)
- クラス (11)
ライブラリ
- ビルトイン (88)
クラス
-
Enumerator
:: Lazy (44)
モジュール
- Enumerable (33)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - Lazy (11)
-
NEWS for Ruby 2
. 6 . 0 (6) - lazy (11)
-
take
_ while (22)
検索結果
先頭5件
-
Enumerable
# zip(*lists) -> [[object]] (39126.0) -
self と引数に渡した配列の各要素からなる配列の配列を生成して返します。 生成される配列の要素数は self の要素数と同じです。
...(1..3).zip([4,5,6], [7,8,9])
# => [[1, 4, 7], [2, 5, 8], [3, 6, 9]]
p (1..2).zip([:a,:b,:c], [:A,:B,:C,:D])
# => a, :A], [2, :b, :B
p (1..5).zip([:a,:b,:c], [:A,:B,:C,:D])
# => [[1, :a, :A], [2, :b, :B],
# [3, :c, :C], [4, nil, :D], [5, nil, nil]]
//}
//emlist[例][ruby]{
p [1,2,3].zip([4,5,6... -
Enumerable
# zip(*lists) {|v1 , v2 , . . . | . . . } -> nil (39126.0) -
self と引数に渡した配列の各要素からなる配列の配列を生成して返します。 生成される配列の要素数は self の要素数と同じです。
...(1..3).zip([4,5,6], [7,8,9])
# => [[1, 4, 7], [2, 5, 8], [3, 6, 9]]
p (1..2).zip([:a,:b,:c], [:A,:B,:C,:D])
# => a, :A], [2, :b, :B
p (1..5).zip([:a,:b,:c], [:A,:B,:C,:D])
# => [[1, :a, :A], [2, :b, :B],
# [3, :c, :C], [4, nil, :D], [5, nil, nil]]
//}
//emlist[例][ruby]{
p [1,2,3].zip([4,5,6... -
Enumerable
# lazy -> Enumerator :: Lazy (21006.0) -
自身を lazy な Enumerator に変換したものを返します。
...義されています。
* map/collect
* flat_map/collect_concat
* select/find_all
* reject
* grep
* take, take_while
* drop, drop_while
* zip (※一貫性のため、ブロックを渡さないケースのみlazy)
* cycle (※一貫性のため、ブロックを渡さないケースの... -
Enumerator
:: Lazy # zip(*lists) -> Enumerator :: Lazy (18176.0) -
Enumerable#zip と同じですが、配列ではなくEnumerator::Lazy を返します。
...
Enumerable#zip と同じですが、配列ではなくEnumerator::Lazy を返します。
ただし一貫性のため、ブロック付きで呼び出した場合は Enumerable#zip と
同じ挙動になります。
//emlist[例][ruby]{
1.step.lazy.zip(('a'..'z').cycle)
# => #<Enumerator::Lazy: #......<Enumerator::Lazy: #<Enumerator: 1:step>>:zip(#<Enumerator: "a".."z":cycle>)>
1.step.lazy.zip(('a'..'z').cycle).take(30).force.last(6)
# => [[25, "y"], [26, "z"], [27, "a"], [28, "b"], [29, "c"], [30, "d"]]
//}
@see Enumerable#zip... -
Enumerator
:: Lazy # zip(*lists) {|v1 , v2 , . . . | . . . } -> nil (18176.0) -
Enumerable#zip と同じですが、配列ではなくEnumerator::Lazy を返します。
...
Enumerable#zip と同じですが、配列ではなくEnumerator::Lazy を返します。
ただし一貫性のため、ブロック付きで呼び出した場合は Enumerable#zip と
同じ挙動になります。
//emlist[例][ruby]{
1.step.lazy.zip(('a'..'z').cycle)
# => #<Enumerator::Lazy: #......<Enumerator::Lazy: #<Enumerator: 1:step>>:zip(#<Enumerator: "a".."z":cycle>)>
1.step.lazy.zip(('a'..'z').cycle).take(30).force.last(6)
# => [[25, "y"], [26, "z"], [27, "a"], [28, "b"], [29, "c"], [30, "d"]]
//}
@see Enumerable#zip... -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (156.0) -
1.6.8から1.8.0への変更点(まとめ) * ((<1.6.8から1.8.0への変更点(まとめ)/インタプリタの変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたクラス/モジュール>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたメソッド>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加された定数>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張されたクラス/メソッド(互換性のある変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/変更されたクラス/メソッド(互換性のない変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/文法の変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/正規表現>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Marshal>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Windows 対応>)) * ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>)) * ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>)) * ((<1.6.8から1.8.0への変更点(まとめ)/バグ修正>)) * ((<1.6.8から1.8.0への変更点(まとめ)/サポートプラットフォームの追加>))
...lename の別名) ((<ruby-dev:20197>))
=== Array
: ((<Array#transpose|Array/transpose>)) [new]
追加
: ((<Array#zip|Enumerable/zip>)) [new]
: ((<Enumerable#zip|Enumerable/zip>)) [new]
追加
: ((<Array#fetch|Array/fetch>)) [new]
追加
: ((<Array#insert|Array/insert>)) [new]......。
=== Enumerable
: ((<Enumerable#partition|Enumerable/partition>)) [new]
追加
: ((<Enumerable#sort_by|Enumerable/sort_by>)) [new]
追加。((<ruby-dev:8986>))以降で提案された Schwartzian transform
を行うための sort です。
: ((<Enumerable#all?|Enumerable/all?>))......[new]
: ((<Enumerable#any?|Enumerable/any?>)) [new]
: ((<Enumerable#inject|Enumerable/inject>)) [new]
追加
=== File
: ((<File/File.extname>)) [new]
追加。ファイル名の拡張子を返します。((<ruby-talk:37617>))
: ((<File/File.fnmatch>)) [new]
: ((<Fil... -
NEWS for Ruby 2
. 6 . 0 (48.0) -
NEWS for Ruby 2.6.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...# ary[1..-1] と同じ
(1...).each {|index| block } # index が 1 から始まる無限ループ
ary.zip(1..) {|elem, index| block } # ary.each.with_index(1) { }
//}
* キーワード引数のハッシュに Symbol 以外のキーが含まれると......追加 13969
* Enumerable
* 新規メソッド
* Enumerable#chain はレシーバと引数のそれぞれの要素を順番にイテレートする
Enumerator::Chain オブジェクトを返します。 15144
* 変更されたメソッド
* Enumerable#to_h はブロ......を受け取りキーと値のペアを新しいキーと値に変換できるようになりました。 15143
* 別名
* Enumerable#filter が Enumerable#select の別名として追加されました。 13784
* Enumerator::ArithmeticSequence
* 等差数列(隣接する項が共... -
Enumerator
:: Lazy # take _ while -> Enumerator :: Lazy (40.0) -
Enumerable#take_while と同じですが、配列ではなくEnumerator::Lazy を返します。
...
Enumerable#take_while と同じですが、配列ではなくEnumerator::Lazy を返します。
//emlist[例][ruby]{
1.step.lazy.zip(('a'..'z').cycle).take_while { |e| e.first < 100_000 }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:zip(#<Enumerator: "a"........"z":cycle>)>:take_while>
1.step.lazy.zip(('a'..'z').cycle).take_while { |e| e.first < 100_000 }.force.last(5)
# => [[99995, "y"], [99996, "z"], [99997, "a"], [99998, "b"], [99999, "c"]]
//}
@see Enumerable#take_while... -
Enumerator
:: Lazy # take _ while {|item| . . . } -> Enumerator :: Lazy (40.0) -
Enumerable#take_while と同じですが、配列ではなくEnumerator::Lazy を返します。
...
Enumerable#take_while と同じですが、配列ではなくEnumerator::Lazy を返します。
//emlist[例][ruby]{
1.step.lazy.zip(('a'..'z').cycle).take_while { |e| e.first < 100_000 }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:zip(#<Enumerator: "a"........"z":cycle>)>:take_while>
1.step.lazy.zip(('a'..'z').cycle).take_while { |e| e.first < 100_000 }.force.last(5)
# => [[99995, "y"], [99996, "z"], [99997, "a"], [99998, "b"], [99999, "c"]]
//}
@see Enumerable#take_while... -
Enumerator
:: Lazy (18.0) -
map や select などのメソッドの遅延評価版を提供するためのクラス。
...er, slice_when
* chunk
* zip (※互換性のため、ブロックを渡さないケースのみlazy)
Lazyオブジェクトは、Enumerable#lazyメソッドによって生成されます。
Lazyから値を取り出すには、Enumerator::Lazy#force または
Enumerable#first を呼びます。......nk, chunk_while
* uniq
* zip (※互換性のため、ブロックを渡さないケースのみlazy)
Lazyオブジェクトは、Enumerable#lazyメソッドによって生成されます。
Lazyから値を取り出すには、Enumerator::Lazy#force または
Enumerable#first を呼びます。......hile
* uniq
* compact
* zip (※互換性のため、ブロックを渡さないケースのみlazy)
Lazyオブジェクトは、Enumerable#lazyメソッドによって生成されます。
Lazyから値を取り出すには、Enumerator::Lazy#force または
Enumerable#first を呼びます。...