るりまサーチ

最速Rubyリファレンスマニュアル検索!
693件ヒット [1-100件を表示] (0.095秒)
トップページ > クエリ:r[x] > クエリ:lazy[x]

別のキーワード

  1. _builtin to_r
  2. open3 pipeline_r
  3. matrix elements_to_r
  4. fileutils rm_r
  5. fileutils cp_r

検索結果

<< 1 2 3 ... > >>

Enumerator::Lazy#lazy -> self (24149.0)

self を返します。

...self を返します。

//emlist[例][ruby]{
lazy
= (100..Float::INFINITY).lazy
p lazy.lazy # => #<Enumerator::Lazy: 100..Infinity>
p lazy == lazy.lazy # => true
//}...

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

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

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

この Enumerator は、以下のメソッドが遅延評価を行う (つまり、配列ではな
くEnumeratorを返す) ように再定義されています。

* map/collect
* flat_map/collect_concat
* select/find_all
* reject...
...* grep
* take, take_while
* drop, drop_while
* zip (※一貫性のため、ブロックを渡さないケースのみlazy)
* cycle (※一貫性のため、ブロックを渡さないケースのみlazy)

以下はピタゴラス数 (a**2 + b**2 = c**2 を満たす自然数 a, b, c の組) を...
...][ruby]{
def pythagorean_triples
(1..Float::INFINITY).lazy.flat_map {|z|
(1..z).flat_map {|x|
(x..z).select {|y|
x**2 + y**2 == z**2
}.map {|y|
[x, y, z]
}
}
}
end
# 最初の10個のピタゴラス数を表示する
p pythagorean_triples.take(10).force...

Win32::Registry::Constants::REG_FORCE_RESTORE (21301.0)

@todo

@todo

Win32::Registry::Constants::REG_REFRESH_HIVE (21301.0)

@todo

@todo

Win32::Registry::Constants::REG_NO_LAZY_FLUSH (18201.0)

@todo

@todo

絞り込み条件を変える

Win32::Registry::Constants::REG_WHOLE_HIVE_VOLATILE (15101.0)

@todo

@todo

Fiddle::Handle::RTLD_LAZY -> Integer (12217.0)

dlopen のフラグ RTLD_LAZY を表す定数です。

...dlopen のフラグ RTLD_LAZY を表す定数です。

DL::Handle.new の flags として用います。

詳しくは dlopen(3) を見てください。...

Enumerator::Lazy#enum_for(method = :each, *args) -> Enumerator::Lazy (9286.0)

Object#to_enum と同じですが、Enumerator::Lazy を返します。

...rator::Lazy を返します。

to_enum は「ブロック付きで呼ぶとループを実行し、ブロックを省略した場合は
Enumerator を返す」ようなメソッドを定義するときによく使われます。
このときに lazy 性が正しく引き継がれるように、Lazy...
...#to_enum は
素のEnumerator ではなく Enumerator::Lazy を返すようになっています。

//emlist[例][ruby]{
module Enumerable
# 要素をn回ずつ繰り返すメソッド
# 例:[1,2,3].repeat(2) #=> [1,1,2,2,3,3]
def repeat(n)
r
aise ArgumentError if n < 0
if block_giv...
..._enum(:repeat, n)
end
end
end

r
= 1..10
p r.map{|n| n**2}.repeat(2).first(5)
#=> [1, 1, 4, 4, 9]

r
= 1..Float::INFINITY
p r.lazy.map{|n| n**2}.repeat(2).first(5)
#=> [1, 1, 4, 4, 9]

# Lazy#to_enum のおかげで、repeat の返り値は
# もとが Enumerator のときは Enumerator に、...

Enumerator::Lazy#enum_for(method = :each, *args) {|*args| block} -> Enumerator::Lazy (9286.0)

Object#to_enum と同じですが、Enumerator::Lazy を返します。

...rator::Lazy を返します。

to_enum は「ブロック付きで呼ぶとループを実行し、ブロックを省略した場合は
Enumerator を返す」ようなメソッドを定義するときによく使われます。
このときに lazy 性が正しく引き継がれるように、Lazy...
...#to_enum は
素のEnumerator ではなく Enumerator::Lazy を返すようになっています。

//emlist[例][ruby]{
module Enumerable
# 要素をn回ずつ繰り返すメソッド
# 例:[1,2,3].repeat(2) #=> [1,1,2,2,3,3]
def repeat(n)
r
aise ArgumentError if n < 0
if block_giv...
..._enum(:repeat, n)
end
end
end

r
= 1..10
p r.map{|n| n**2}.repeat(2).first(5)
#=> [1, 1, 4, 4, 9]

r
= 1..Float::INFINITY
p r.lazy.map{|n| n**2}.repeat(2).first(5)
#=> [1, 1, 4, 4, 9]

# Lazy#to_enum のおかげで、repeat の返り値は
# もとが Enumerator のときは Enumerator に、...
<< 1 2 3 ... > >>