[#92070] [Ruby trunk Feature#15667] Introduce malloc_trim(0) in full gc cycles — sam.saffron@...
Issue #15667 has been updated by sam.saffron (Sam Saffron).
3 messages
2019/04/01
[ruby-core:92504] [Ruby trunk Bug#15745] There is no symmetry in the beginless range and the endless range using `Range#inspect`
From:
eregontp@...
Date:
2019-04-30 21:20:02 UTC
List:
ruby-core #92504
Issue #15745 has been updated by Eregon (Benoit Daloze).
I didn't realize, but Range#to_s and Range#inspect differ by calling #to_s and #inspect on both ends:
```
puts ('a'..'z').to_s
# => a..z
puts ('a'..'z').inspect
# => "a".."z"
```
Following that, for `("a"..)` we'd get `a..` and `"a"..nil`, which I agree is weird for an open end to change representation based on #to_s/#inspect.
So in the spirit of most #inspect methods printing what one would write for the Ruby literal I'd be inclined for (2), that is `1..`, `..1` and `nil..nil`.
----------------------------------------
Bug #15745: There is no symmetry in the beginless range and the endless range using `Range#inspect`
https://bugs.ruby-lang.org/issues/15745#change-77865
* Author: koic (Koichi ITO)
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
* ruby -v: ruby 2.7.0dev (2019-04-03 trunk 67423) [x86_64-darwin17]
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
The following commit introduces beginless range.
https://github.com/ruby/ruby/commit/95f7992b89efd35de6b28ac095c4d3477019c583
```
% ruby -v
ruby 2.7.0dev (2019-04-03 trunk 67423) [x86_64-darwin17]
```
There is no symmetry with endless range when using `Range#inspect` method.
```
(1..).inspect # => "1.."
(..5).inspect # => "nil..5"
```
How about unifying whether it represents `nil`?
--
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>