132件ヒット
[101-132件を表示]
(0.128秒)
別のキーワード
クラス
- Array (24)
-
Enumerator
:: Lazy (48) - Object (24)
モジュール
- Enumerable (36)
キーワード
- lazy (12)
-
pretty
_ print (12) -
pretty
_ print _ cycle (12) -
take
_ while (24) - zip (24)
検索結果
先頭3件
-
Enumerator
:: Lazy # zip(*lists) {|v1 , v2 , . . . | . . . } -> nil (25.0) -
Enumerable#zip と同じですが、配列ではなくEnumerator::Lazy を返します。
...erable#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"... -
Enumerable
# lazy -> Enumerator :: Lazy (13.0) -
自身を lazy な Enumerator に変換したものを返します。
...渡さないケースのみlazy)
* cycle (※一貫性のため、ブロックを渡さないケースのみlazy)
以下はピタゴラス数 (a**2 + b**2 = c**2 を満たす自然数 a, b, c の組) を
列挙するプログラムです。
//emlist[例][ruby]{
def pythagorean_triples
(1..Float... -
Object
# pretty _ print(pp) -> () (13.0) -
PP.pp や Kernel.#pp がオブジェクトの内容を出力するときに 呼ばれるメソッドです。PP オブジェクト pp を引数として呼ばれます。
...。
@param pp PP オブジェクトです。
//emlist[][ruby]{
require 'pp'
class Array
def pretty_print(q)
q.group(1, '[', ']') {
q.seplist(self) {|v|
q.pp v
}
}
end
end
//}
@see Object#pretty_print_cycle, Object#inspect, PrettyPrint#text, PrettyPrint#group, Pret......ます。
@param pp PP オブジェクトです。
//emlist[][ruby]{
class Array
def pretty_print(q)
q.group(1, '[', ']') {
q.seplist(self) {|v|
q.pp v
}
}
end
end
//}
@see Object#pretty_print_cycle, Object#inspect, PrettyPrint#text, PrettyPrint#group, PrettyPrint#...