[#107008] [Ruby master Bug#18465] Make `IO#write` atomic. — "ioquatix (Samuel Williams)" <noreply@...>
Issue #18465 has been reported by ioquatix (Samuel Williams).
16 messages
2022/01/09
[#107150] [Ruby master Feature#18494] [RFC] ENV["RUBY_GC_..."]= changes GC parameters dynamically — "ko1 (Koichi Sasada)" <noreply@...>
Issue #18494 has been updated by ko1 (Koichi Sasada).
4 messages
2022/01/17
[#107170] Re: [Ruby master Feature#18494] [RFC] ENV["RUBY_GC_..."]= changes GC parameters dynamically
— Eric Wong <normalperson@...>
2022/01/17
> https://bugs.ruby-lang.org/issues/18494
[#107302] [Ruby master Bug#18553] Memory leak on compiling method call with kwargs — "ibylich (Ilya Bylich)" <noreply@...>
Issue #18553 has been reported by ibylich (Ilya Bylich).
4 messages
2022/01/27
[#107346] [Ruby master Misc#18557] DevMeeting-2022-02-17 — "mame (Yusuke Endoh)" <noreply@...>
Issue #18557 has been reported by mame (Yusuke Endoh).
18 messages
2022/01/29
[ruby-core:107326] [Ruby master Feature#18551] Make Range#reverse_each to raise an exception if endless
From:
"Dan0042 (Daniel DeLorme)" <noreply@...>
Date:
2022-01-28 16:16:02 UTC
List:
ruby-core #107326
Issue #18551 has been updated by Dan0042 (Daniel DeLorme).
Yes, this is a useful change. Although wouldn't it be better to prevent `#to_a` instead of only `#reverse_each` ?
Actually there's quite a lot of Enumerable methods that would be better raising an exception for endless ranges.
For example: `(1..).select{ true }` results in infinite loop and memory consumption.
The only way out is `break`, but then there's no point using `select` since it can't return a result.
The same applies to reject, partition, sort, zip, uniq, tally, etc...
----------------------------------------
Feature #18551: Make Range#reverse_each to raise an exception if endless
https://bugs.ruby-lang.org/issues/18551#change-96224
* Author: kyanagi (Kouhei Yanagita)
* Status: Open
* Priority: Normal
----------------------------------------
https://github.com/ruby/ruby/pull/5498
Currently, `Range#reverse_each` for an endless range never returns.
```
% ruby -e '(1..).reverse_each { }'
# never return ...
```
(This is because `Enumerable#reverse_each` tries `#to_a` and `#to_a` for an endless range comes into an infinite loop.)
I think `Range#reverse_each` for an endless range should raise an exception, similar to `Range#each` for a beginless range.
```
% ruby -e '(..1).each { }'
-e:1:in `each': can't iterate from NilClass (TypeError)
from -e:1:in `<main>'
```
--
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>