[#83773] [Ruby trunk Bug#14108] Seg Fault with MinGW on svn 60769 — usa@...
Issue #14108 has been updated by usa (Usaku NAKAMURA).
9 messages
2017/11/15
[#83774] Re: [Ruby trunk Bug#14108] Seg Fault with MinGW on svn 60769
— Eric Wong <normalperson@...>
2017/11/15
usa@garbagecollect.jp wrote:
[#83775] Re: [Ruby trunk Bug#14108] Seg Fault with MinGW on svn 60769
— "U.NAKAMURA" <usa@...>
2017/11/15
Hi, Eric
[#83779] Re: [Ruby trunk Bug#14108] Seg Fault with MinGW on svn 60769
— Eric Wong <normalperson@...>
2017/11/15
"U.NAKAMURA" <usa@garbagecollect.jp> wrote:
[#83781] Re: [Ruby trunk Bug#14108] Seg Fault with MinGW on svn 60769
— "U.NAKAMURA" <usa@...>
2017/11/15
Hi, Eric,
[#83782] Re: [Ruby trunk Bug#14108] Seg Fault with MinGW on svn 60769
— Eric Wong <normalperson@...>
2017/11/15
"U.NAKAMURA" <usa@garbagecollect.jp> wrote:
[ruby-core:83687] [Ruby trunk Bug#14086] Interpreter seems to sneak in a nil value when a comma is missing on a nested array wrapped in parenthesis
From:
zverok.offline@...
Date:
2017-11-06 10:57:14 UTC
List:
ruby-core #83687
Issue #14086 has been updated by zverok (Victor Shepelev). > is this the expected behaviour? Yes. Try this: ```ruby [2, 2][3, 3] # => nil ``` Why? Because it is read as "Array of `[2,2]`, call operator [] with arguments `3, 3` (which means fetch 3 elements starting from 3rd)". As this array doesn't have a 3rd element, the result of the operation is `nil`. So the first item of your larger array is the result of this calculation, e.g. `nil`. ---------------------------------------- Bug #14086: Interpreter seems to sneak in a nil value when a comma is missing on a nested array wrapped in parenthesis https://bugs.ruby-lang.org/issues/14086#change-67713 * Author: mariogintili (Mario Gintili) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: * Backport: 2.3: UNKNOWN, 2.4: UNKNOWN ---------------------------------------- I believe the title is self explanatory. But code is always louder than words: ~~~ ruby $ ruby --version ruby 2.2.4p230 (2015-12-16 revision 53155) [x86_64-darwin16] $ irb 2.2.4 :001 > ([[2,2], [3,3], [4,4], [5,5], [6,6]]) => [[2, 2], [3, 3], [4, 4], [5, 5], [6, 6]] 2.2.4 :002 > ([[2,2] [3,3], [4,4], [5,5], [6,6]]) => [nil, [4, 4], [5, 5], [6, 6]] ~~~ the only difference between lines 1 and 2 in my REPL is a coma right after the first nested array. is this the expected behaviour? -- https://bugs.ruby-lang.org/ Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>