<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/ruby.git/struct.c, branch ruby_3_2</title>
<subtitle>github.com: ruby/ruby.git
</subtitle>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/ruby.git/'/>
<entry>
<title>Docs: Update Struct docs about keyword initialization</title>
<updated>2022-12-23T16:09:49+00:00</updated>
<author>
<name>zverok</name>
<email>zverok.offline@gmail.com</email>
</author>
<published>2022-12-21T19:23:14+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/ruby.git/commit/?id=b3d57fdd64d2e88499bf718e64522dfce9358c48'/>
<id>b3d57fdd64d2e88499bf718e64522dfce9358c48</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Add copy with changes functionality for Data objects (#6766)</title>
<updated>2022-12-22T00:27:38+00:00</updated>
<author>
<name>Ufuk Kayserilioglu</name>
<email>ufuk@paralaus.com</email>
</author>
<published>2022-12-22T00:27:38+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/ruby.git/commit/?id=99cee85775bc5656b942bf4e1b0568a8f40addcd'/>
<id>99cee85775bc5656b942bf4e1b0568a8f40addcd</id>
<content type='text'>
Implements [Feature #19000]

This commit adds copy with changes functionality for `Data` objects
using a new method `Data#with`.

Since Data objects are immutable, the only way to change them is by
creating a copy. This PR adds a `with` method for `Data` class instances
that optionally takes keyword arguments.

If the `with` method is called with no arguments, the behaviour is the
same as the `Kernel#dup` method, i.e. a new shallow copy is created
with no field values changed.

However, if keyword arguments are supplied to the `with` method, then
the copy is created with the specified field values changed. For
example:
```ruby
    Point = Data.define(:x, :y)
    point = Point.new(x: 1, y: 2)
    point.with(x: 3) # =&gt; #&lt;data Point x: 3, y: 2&gt;
```

Passing positional arguments to `with` or passing keyword arguments to
it that do not correspond to any of the members of the Data class will
raise an `ArgumentError`.

Co-authored-by: Alan Wu &lt;XrXr@users.noreply.github.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Implements [Feature #19000]

This commit adds copy with changes functionality for `Data` objects
using a new method `Data#with`.

Since Data objects are immutable, the only way to change them is by
creating a copy. This PR adds a `with` method for `Data` class instances
that optionally takes keyword arguments.

If the `with` method is called with no arguments, the behaviour is the
same as the `Kernel#dup` method, i.e. a new shallow copy is created
with no field values changed.

However, if keyword arguments are supplied to the `with` method, then
the copy is created with the specified field values changed. For
example:
```ruby
    Point = Data.define(:x, :y)
    point = Point.new(x: 1, y: 2)
    point.with(x: 3) # =&gt; #&lt;data Point x: 3, y: 2&gt;
```

Passing positional arguments to `with` or passing keyword arguments to
it that do not correspond to any of the members of the Data class will
raise an `ArgumentError`.

Co-authored-by: Alan Wu &lt;XrXr@users.noreply.github.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[Feature #19163] Marshal-loaded Data object also should be frozen</title>
<updated>2022-12-01T15:56:52+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2022-12-01T13:50:25+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/ruby.git/commit/?id=5872fd6f6cc5ddde33df94fb11e773eeb653e55e'/>
<id>5872fd6f6cc5ddde33df94fb11e773eeb653e55e</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[Feature #19163] Data object should be frozen</title>
<updated>2022-12-01T15:56:52+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2022-12-01T08:26:45+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/ruby.git/commit/?id=a14a1a5626a4d8e661a3e606f8f92b8c455b9a04'/>
<id>a14a1a5626a4d8e661a3e606f8f92b8c455b9a04</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Use RTEST and add test for GH-6832</title>
<updated>2022-11-30T21:27:39+00:00</updated>
<author>
<name>Alan Wu</name>
<email>XrXr@users.noreply.github.com</email>
</author>
<published>2022-11-30T20:04:31+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/ruby.git/commit/?id=5752d11f1f33d277356373da749db111e03c96b5'/>
<id>5752d11f1f33d277356373da749db111e03c96b5</id>
<content type='text'>
Technically we shouldn't see Qfalse now, but RTEST also compiles down to
just one branch anyways. Pretty contrived issue, but easy to fix.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Technically we shouldn't see Qfalse now, but RTEST also compiles down to
just one branch anyways. Pretty contrived issue, but easy to fix.
</pre>
</div>
</content>
</entry>
<entry>
<title>struct.c (struct_ivar_get): add conditional for potential Qnil returned by rb_class_superclass</title>
<updated>2022-11-30T21:27:39+00:00</updated>
<author>
<name>Zack Deveau</name>
<email>zack.ref@gmail.com</email>
</author>
<published>2022-11-29T19:40:43+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/ruby.git/commit/?id=4b9d10b8330b5072993f2c32eaf701c5c1aa7e55'/>
<id>4b9d10b8330b5072993f2c32eaf701c5c1aa7e55</id>
<content type='text'>
struct_ivar_get recently started using rb_class_superclass to
resolve super instead of RCLASS_SUPER. This change made
Qnil a possible case we need to return from within the
struct_ivar_get for loop.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
struct_ivar_get recently started using rb_class_superclass to
resolve super instead of RCLASS_SUPER. This change made
Qnil a possible case we need to return from within the
struct_ivar_get for loop.
</pre>
</div>
</content>
</entry>
<entry>
<title>Using UNDEF_P macro</title>
<updated>2022-11-16T09:58:33+00:00</updated>
<author>
<name>S-H-GAMELINKS</name>
<email>gamelinks007@gmail.com</email>
</author>
<published>2022-11-15T04:24:08+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/ruby.git/commit/?id=1f4f6c9832d83e7ebd65ccf4e95cef358b3512c6'/>
<id>1f4f6c9832d83e7ebd65ccf4e95cef358b3512c6</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>fix Data docs (#6497)</title>
<updated>2022-10-06T17:13:17+00:00</updated>
<author>
<name>Yuri Smirnov</name>
<email>tycooon@yandex.ru</email>
</author>
<published>2022-10-06T17:13:17+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/ruby.git/commit/?id=13e87e5049dd418e764f30a9cc45f787d239d466'/>
<id>13e87e5049dd418e764f30a9cc45f787d239d466</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Cannot `define` from defined `Data` class again</title>
<updated>2022-10-03T14:28:01+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2022-10-03T14:28:01+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/ruby.git/commit/?id=cbd82f52502630e5298c8b82e8d52c59ee5454e1'/>
<id>cbd82f52502630e5298c8b82e8d52c59ee5454e1</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Use the dedicated function to check arity</title>
<updated>2022-10-01T07:24:36+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2022-10-01T07:18:03+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/ruby.git/commit/?id=56f2fd3bc9bbc69abe75def25f89dac41eb19773'/>
<id>56f2fd3bc9bbc69abe75def25f89dac41eb19773</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
