[#103241] [Ruby master Bug#17777] 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99 — eregontp@...
Issue #17777 has been reported by Eregon (Benoit Daloze).
17 messages
2021/04/05
[#103305] [Ruby master Feature#17785] Allow named parameters to be keywords — marcandre-ruby-core@...
Issue #17785 has been reported by marcandre (Marc-Andre Lafortune).
21 messages
2021/04/08
[#103342] [Ruby master Feature#17790] Have a way to clear a String without resetting its capacity — jean.boussier@...
Issue #17790 has been reported by byroot (Jean Boussier).
14 messages
2021/04/09
[#103388] [ANN] Multi-factor Authentication of bugs.ruby-lang.org — SHIBATA Hiroshi <hsbt@...>
Hello,
5 messages
2021/04/12
[#103414] Re: [ANN] Multi-factor Authentication of bugs.ruby-lang.org
— Martin J. Dürst <duerst@...>
2021/04/13
Is there a way to use this multi-factor authentication for (like me)
[#103547] List of CI sites to check — Martin J. Dürst <duerst@...>
Hello everybody,
4 messages
2021/04/22
[#103596] [Ruby master Feature#17830] Add Integer#previous and Integer#prev — rafasoaresms@...
Issue #17830 has been reported by rafasoares (Rafael Soares).
9 messages
2021/04/26
[ruby-core:103192] [Ruby master Bug#17767] `Cloned ENV` inconsistently returns `ENV` or `self`
From:
merch-redmine@...
Date:
2021-04-02 21:39:03 UTC
List:
ruby-core #103192
Issue #17767 has been updated by jeremyevans0 (Jeremy Evans).
I don't think it makes sense to have cloned ENV objects. I propose the following behavior:
* `ENV.dup`/`ENV.clone`/`ENV.clone(freeze: nil)`/`ENV.clone(freeze: false)` should return `ENV`, since the same singleton storage is used (the environ table).
* `ENV.clone(freeze: true)` should raise `TypeError`, the same as `ENV.freeze`.
`ENV.dup` previously returned a useless instance of `Object`, since all `ENV` behavior is defined on a singleton class.
I've submitted a pull request implementing this proposal: https://github.com/ruby/ruby/pull/4350
----------------------------------------
Bug #17767: `Cloned ENV` inconsistently returns `ENV` or `self`
https://bugs.ruby-lang.org/issues/17767#change-91267
* Author: kachick (Kenichi Kamiya)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin20]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
GH-PR: https://github.com/ruby/ruby/pull/4344
Is this an expected behavior?
```console
$ ruby -v
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin20]
```
```ruby
cloned_env = ENV.clone
p ENV.each_key{}.equal?(ENV) #=> true
p cloned_env.each_key{}.equal?(cloned_env) #=> true
ENV.delete('TEST')
err = ENV.fetch('TEST') rescue $!
p err.receiver.equal?(ENV) #=> true
err = cloned_env.fetch('TEST') rescue $!
p err.receiver.equal?(cloned_env) #=> false
ENV['TEST'] = 'TRUE'
p ENV.select!{ false }.equal?(ENV) #=> true
cloned_env['TEST'] = 'TRUE'
p cloned_env.select!{ false }.equal?(cloned_env) #=> false
```
I guess ruby don't care `Cloned ENV` objects.
Yes, anyone basically do not write these code.
But the behaviors looks weird to me.
Should block to clone?
Should return ENV?
Should return self?
I think `they return self` makes consistently behaviors and does not break compatibilities.
So I have created this PR
--
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>