From: aycabta@... Date: 2018-06-05T10:45:39+00:00 Subject: [ruby-core:87414] [Ruby trunk Bug#14824][Open] Endless Range Support in irb Issue #14824 has been updated by aycabta (aycabta .). Status changed from Rejected to Open mame (Yusuke Endoh) wrote: > In principle, I expect irb to cut the shortest lines that parses. Ah, well, you got that right. I understand an importance of this issue. So I re-open this. > BTW, a line `obj.+` causes line continuation. This is a behavior that I don't expect: > > ``` > irb(main):001:0> obj = Object.new > => # > irb(main):002:0> def obj.+(); 42; end > => :+ > irb(main):003:0> obj.+ > irb(main):004:0* > irb(main):005:0* ; > => 42 > ``` It will be fixed by https://bugs.ruby-lang.org/issues/14683, but this issue will not. Therefore, I guess that https://bugs.ruby-lang.org/issues/14808 is needed for this issue too. ---------------------------------------- Bug #14824: Endless Range Support in irb https://bugs.ruby-lang.org/issues/14824#change-72401 * Author: jeremyevans0 (Jeremy Evans) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: ruby 2.6.0preview2 (2018-05-31 trunk 63539) [x86_64-openbsd] * Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN ---------------------------------------- `irb` currently doesn't have great support for endless ranges, forcing you to use explicit parentheses around the endless range. Without explicit parentheses, it treats the endless range as a line continuation. ~~~ irb(main):001:0> 1.. irb(main):002:0* ; => 1.. irb(main):003:0> (1..) => 1.. irb(main):004:0> ~~~ Ranges with ends do not require parentheses in `irb`, and endless ranges should have the same behavior. -- https://bugs.ruby-lang.org/ Unsubscribe: