[#111712] [Ruby master Feature#19322] Support spawning "private" child processes — "kjtsanaktsidis (KJ Tsanaktsidis) via ruby-core" <ruby-core@...>
SXNzdWUgIzE5MzIyIGhhcyBiZWVuIHJlcG9ydGVkIGJ5IGtqdHNhbmFrdHNpZGlzIChLSiBUc2Fu
14 messages
2023/01/07
[ruby-core:111747] [Ruby master Feature#19261] `Data#members` is not important
From:
"k0kubun (Takashi Kokubun) via ruby-core" <ruby-core@...>
Date:
2023-01-09 19:27:12 UTC
List:
ruby-core #111747
Issue #19261 has been updated by k0kubun (Takashi Kokubun).
If we were to remove this from Data instances, I'd like Struct instances to not have that method either. Let's say you replace Struct.new with Data.define for something that's already immutable, I don't want that change to break anything. But `Data` randomly lacking some shorthand methods that exist for Struct would make such refactoring dangerous.
----------------------------------------
Feature #19261: `Data#members` is not important
https://bugs.ruby-lang.org/issues/19261#change-101149
* Author: ko1 (Koichi Sasada)
* Status: Open
* Priority: Normal
----------------------------------------
`Data#members` is defined but it is calculated by `self.class.members` (in other words, `#members` is a shorthand for `self.class.members`).
So it is better to remove this method.
```ruby
P = Data.define(:x, :y)
p P.new(1, 2).members #=> [:x, :y]
Group = Data.define(:name, :members)
gs = Group.new('SasadaFamily', %w(ko1 yuki))
p gs.members #=> ["ko1", "yuki"]
```
---Files--------------------------------
data-members-remove-method.patch (1.87 KB)
--
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/