* [ruby-dev:52007] [Ruby master Feature#19163] Data object should be frozen
@ 2022-12-01 8:06 matz (Yukihiro Matsumoto)
2022-12-01 9:01 ` [ruby-dev:52008] " nobu (Nobuyoshi Nakada)
0 siblings, 1 reply; 2+ messages in thread
From: matz (Yukihiro Matsumoto) @ 2022-12-01 8:06 UTC (permalink / raw)
To: ruby-dev
Issue #19163 has been reported by matz (Yukihiro Matsumoto).
----------------------------------------
Feature #19163: Data object should be frozen
https://bugs.ruby-lang.org/issues/19163
* Author: matz (Yukihiro Matsumoto)
* Status: Open
* Priority: Normal
----------------------------------------
If we call `initialize` (via `send`), we can rewrite an existing Data object.
```ruby
d=Data.define(:a, :b).new(1,2)
p d #=> #<data a=1, b=2>
d.send(:initialize, {a:3,b:4})
p d #=> #<data a=3, b=4>
```
Should we freeze the Data object after calling `initialize` for the first time?
Matz.
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 2+ messages in thread
* [ruby-dev:52008] [Ruby master Feature#19163] Data object should be frozen
2022-12-01 8:06 [ruby-dev:52007] [Ruby master Feature#19163] Data object should be frozen matz (Yukihiro Matsumoto)
@ 2022-12-01 9:01 ` nobu (Nobuyoshi Nakada)
0 siblings, 0 replies; 2+ messages in thread
From: nobu (Nobuyoshi Nakada) @ 2022-12-01 9:01 UTC (permalink / raw)
To: ruby-dev
Issue #19163 has been updated by nobu (Nobuyoshi Nakada).
https://github.com/ruby/ruby/pull/6843
----------------------------------------
Feature #19163: Data object should be frozen
https://bugs.ruby-lang.org/issues/19163#change-100399
* Author: matz (Yukihiro Matsumoto)
* Status: Open
* Priority: Normal
----------------------------------------
If we call `initialize` (via `send`), we can rewrite an existing Data object.
```ruby
d=Data.define(:a, :b).new(1,2)
p d #=> #<data a=1, b=2>
d.send(:initialize, {a:3,b:4})
p d #=> #<data a=3, b=4>
```
Should we freeze the Data object after calling `initialize` for the first time?
Matz.
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-12-01 9:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-01 8:06 [ruby-dev:52007] [Ruby master Feature#19163] Data object should be frozen matz (Yukihiro Matsumoto)
2022-12-01 9:01 ` [ruby-dev:52008] " nobu (Nobuyoshi Nakada)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).