[#115244] [Ruby master Feature#19987] add sample method to Range — "horv77@... (Andras Horvath) via ruby-core" <ruby-core@...>
Issue #19987 has been reported by horv77@protonmail.com (Andras Horvath).
6 messages
2023/11/05
[#115247] [Ruby master Feature#19988] AI for inner code behavior analysis at runtime — "horv77@... (Andras Horvath) via ruby-core" <ruby-core@...>
Issue #19988 has been reported by horv77@protonmail.com (Andras Horvath).
3 messages
2023/11/05
[#115404] Ruby 3.2.2 - rbconfig.rb's MAKEFILE_CONFIG — Jay Mav via ruby-core <ruby-core@...>
Hello Ruby Dev Team,
4 messages
2023/11/17
[ruby-core:115498] [Ruby master Feature#18551] Make `Range#reverse_each` to raise an exception if endless
From:
"mame (Yusuke Endoh) via ruby-core" <ruby-core@...>
Date:
2023-11-28 05:49:00 UTC
List:
ruby-core #115498
Issue #18551 has been updated by mame (Yusuke Endoh).
In the previous dev meething, matz accepted this. I will merge the PR
----------------------------------------
Feature #18551: Make `Range#reverse_each` to raise an exception if endless
https://bugs.ruby-lang.org/issues/18551#change-105427
* 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/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/