るりまサーチ

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

別のキーワード

  1. socket ai_v4mapped
  2. socket ipv6_v6only
  3. socket ai_v4mapped_cfg
  4. _builtin grep_v
  5. etc cs_v6_env

ライブラリ

モジュール

キーワード

検索結果

Enumerable#reduce(init = self.first) {|result, item| ... } -> object (15115.0)

リストのたたみこみ演算を行います。

...=> 54
//}

この式は以下のように書いても同じ結果が得られます。

//emlist[例][ruby]{
result = 0
[1, 2, 3, 4, 5].each {|v| result += v }
p result # => 15

p [1, 2, 3, 4, 5].inject(:+) #=> 15
p ["b", "c", "d"].inject("abbccddde", :squeeze) #=> "abcde"
//}...

Enumerable#reduce(init, sym) -> object (15115.0)

リストのたたみこみ演算を行います。

...=> 54
//}

この式は以下のように書いても同じ結果が得られます。

//emlist[例][ruby]{
result = 0
[1, 2, 3, 4, 5].each {|v| result += v }
p result # => 15

p [1, 2, 3, 4, 5].inject(:+) #=> 15
p ["b", "c", "d"].inject("abbccddde", :squeeze) #=> "abcde"
//}...

Enumerable#reduce(sym) -> object (15115.0)

リストのたたみこみ演算を行います。

...=> 54
//}

この式は以下のように書いても同じ結果が得られます。

//emlist[例][ruby]{
result = 0
[1, 2, 3, 4, 5].each {|v| result += v }
p result # => 15

p [1, 2, 3, 4, 5].inject(:+) #=> 15
p ["b", "c", "d"].inject("abbccddde", :squeeze) #=> "abcde"
//}...

ruby 1.8.4 feature (48.0)

ruby 1.8.4 feature ruby 1.8.4 での ruby 1.8.3 からの変更点です。

...((<ruby 1.8.4 feature/TCPSocket#initialize [bug]>))
* ((<ruby 1.8.4 feature/TCPServer#initialize [bug]>))
* ((<ruby 1.8.4 feature/"optparse">))
* ((<ruby 1.8.4 feature/"find">))
* ((<ruby 1.8.4 feature/Iconv>))
* ((<ruby 1.8.4 feature/WEBrick::Config::FileHandler [compat]>))
* ((<ruby 1...
...(<ruby 1.8.4 feature/RDoc [bug]>))
* ((<ruby 1.8.4 feature/Win32API [bug]>))
* ((<ruby 1.8.4 feature/Rinda [bug]>))
* ((<ruby 1.8.4 feature/Iconv [compat]>))
* ((<ruby 1.8.4 feature/cgi [bug]>))
* ((<ruby 1.8.4 feature/DL [bug]>))
* ((<ruby 1.8.4 feature/fileutils [bug]>))
* ((<ruby 1....
...Oct 25 02:12:08 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
#
# * lib/rdoc/markup/simple_markup.rb (SM::SimpleMarkup::LABEL_LIST_RE):
# reduce redundant backtrack. [ruby-talk:161771]

正規表現のバックトラックが深くなりすぎて失敗することがあったバ...

NEWS for Ruby 3.0.0 (24.0)

NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...ation warnings in Ruby 2.7 will now
result in ArgumentError or different behavior. 14183
* Procs accepting a single rest argument and keywords are no longer
subject to autosplatting. This now matches the behavior of Procs
accepting a single rest argument and no keywords.
16166

//...
...* `in` is changed to return `true` or `false`. 17371

//emlist{
0 => a
p a #=> 0

{b: 0, c: 1} => {b:}
p b #=> 0
//}

//emlist{
# version 3.0
0 in 1 #=> false

# version 2.7
0 in 1 #=> raise NoMatchingPatternError
//}

* Find-pattern is added. [EXPERIMENTAL]
16828

//emlist{
case ["a", 1,...
...Class method cache and (3) new invalidation mechanism. (1) can avoid per-method call synchronization because it only uses atomic operations. See the ticket for more details.
* The number of hashes allocated when using a keyword splat in a method call has been reduced to a maximum of 1, and passing...

絞り込み条件を変える

Enumerable#inject(init = self.first) {|result, item| ... } -> object (15.0)

リストのたたみこみ演算を行います。

...=> 54
//}

この式は以下のように書いても同じ結果が得られます。

//emlist[例][ruby]{
result = 0
[1, 2, 3, 4, 5].each {|v| result += v }
p result # => 15

p [1, 2, 3, 4, 5].inject(:+) #=> 15
p ["b", "c", "d"].inject("abbccddde", :squeeze) #=> "abcde"
//}...

Enumerable#inject(init, sym) -> object (15.0)

リストのたたみこみ演算を行います。

...=> 54
//}

この式は以下のように書いても同じ結果が得られます。

//emlist[例][ruby]{
result = 0
[1, 2, 3, 4, 5].each {|v| result += v }
p result # => 15

p [1, 2, 3, 4, 5].inject(:+) #=> 15
p ["b", "c", "d"].inject("abbccddde", :squeeze) #=> "abcde"
//}...

Enumerable#inject(sym) -> object (15.0)

リストのたたみこみ演算を行います。

...=> 54
//}

この式は以下のように書いても同じ結果が得られます。

//emlist[例][ruby]{
result = 0
[1, 2, 3, 4, 5].each {|v| result += v }
p result # => 15

p [1, 2, 3, 4, 5].inject(:+) #=> 15
p ["b", "c", "d"].inject("abbccddde", :squeeze) #=> "abcde"
//}...