[#112457] [Ruby master Feature#19443] Cache `Process.pid` — "byroot (Jean Boussier) via ruby-core" <ruby-core@...>
Issue #19443 has been reported by byroot (Jean Boussier).
16 messages
2023/02/16
[#112584] [Ruby master Feature#19465] [PATCH] reuse open(2) from rb_file_load_ok on POSIX-like system — "normalperson (Eric Wong) via ruby-core" <ruby-core@...>
Issue #19465 has been reported by normalperson (Eric Wong).
9 messages
2023/02/25
[#112595] [Ruby master Feature#19465] [PATCH] reuse open(2) from rb_file_load_ok on POSIX-like system
— "nobu (Nobuyoshi Nakada) via ruby-core" <ruby-core@...>
2023/02/25
SXNzdWUgIzE5NDY1IGhhcyBiZWVuIHVwZGF0ZWQgYnkgbm9idSAoTm9idXlvc2hpIE5ha2FkYSku
[#112613] Re: [Ruby master Feature#19465] [PATCH] reuse open(2) from rb_file_load_ok on POSIX-like system
— Eric Wong via ruby-core <ruby-core@...>
2023/02/26
"nobu (Nobuyoshi Nakada) via ruby-core" <ruby-core@ml.ruby-lang.org> wrote:
[#112615] Re: [Ruby master Feature#19465] [PATCH] reuse open(2) from rb_file_load_ok on POSIX-like system
— SHIBATA Hiroshi via ruby-core <ruby-core@...>
2023/02/27
MzUxMzZlMWU5YzIzMmFkN2EwMzQwN2I5OTJiMmU4NmI2ZGY0M2Y2MyBpcyBicm9rZW4gd2l0aCBg
[#112626] Re: [Ruby master Feature#19465] [PATCH] reuse open(2) from rb_file_load_ok on POSIX-like system
— Eric Wong via ruby-core <ruby-core@...>
2023/02/28
```
[ruby-core:112233] [Ruby master Bug#19418] Checking if a date in an open date range times out when the range starts after the test date
From:
"zverok (Victor Shepelev) via ruby-core" <ruby-core@...>
Date:
2023-02-06 13:50:33 UTC
List:
ruby-core #112233
Issue #19418 has been updated by zverok (Victor Shepelev). [Range#include](https://docs.ruby-lang.org/en/3.1/Range.html#method-i-include-3F) basically iterates throughout the range and compares every value with the target value; it requires only two methods: `value.succ` and `value.==`, and never uses anything else. Therefore, it is infinite iteration when nothing was found. This is a generic implementation that works for all classes, not only for `Date`. Simplest test: ```ruby V = Struct.new(:val) do def succ = V.new(val+1) # this will implement iteration end (V.new(2)..).include?(V.new(1)) # -- hangs forever ``` The `include?` though redefined to behave like [Range#cover?](https://docs.ruby-lang.org/en/3.1/Range.html#method-i-cover-3F) for some range types: namely, numbers and strings. (So, your check of `(2..).include?(1)` doesn't prove "something wrong with Date", it proves "something 'wrong' (specialized for historical reason) with numbers".) `cover?` is the right method to check "if something is inside the range": ```ruby require 'date' ((Date.today + 1)..).cover?(Date.today) #=> false, immediately ``` BTW, just discovered the 3.2 tries to lessen the confusion by prohibiting `include?` on infinite ranges (though it is never mentioned in `NEWS`, hm): ```ruby RUBY_VERSION # => "3.2.0" require 'date' ((Date.today + 1)..).include?(Date.today) # in `include?': cannot determine inclusion in beginless/endless ranges (TypeError) ``` ---------------------------------------- Bug #19418: Checking if a date in an open date range times out when the range starts after the test date https://bugs.ruby-lang.org/issues/19418#change-101655 * Author: wilhelmsen (Hallgeir Wilhelmsen) * Status: Open * Priority: Normal * ruby -v: 3.1.3 * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- ` require 'date' ((Date.today + 1)..).include?(Date.today) ` is expected to return `false`. It never return a value, as like it is in a never ending loop. `((Date.today)..).include?(Date.today)` however, returns `true` right away. `(2..).include?(1)` also returns false, as expected. I.e. this seems to be a date issue and not a range issue, and it seem to happen when the start date comes after the date to check for. -- 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/