<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/ruby/test_proc.rb, branch v3_2_11</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>merge revision(s) 29c480dd6fca993590c82078ba797e2c4e876ac7: [Backport #20853]</title>
<updated>2024-11-10T03:55:34+00:00</updated>
<author>
<name>nagachika</name>
<email>nagachika@ruby-lang.org</email>
</author>
<published>2024-11-10T03:31:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=288e24b73ab20100b63ae7d30fb06a7d8a19de6e'/>
<id>288e24b73ab20100b63ae7d30fb06a7d8a19de6e</id>
<content type='text'>
	[Bug #20853] Fix Proc#hash to not change after compaction

	The hash value of a Proc must remain constant after a compaction, otherwise
	it may not work as the key in a hash table.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	[Bug #20853] Fix Proc#hash to not change after compaction

	The hash value of a Proc must remain constant after a compaction, otherwise
	it may not work as the key in a hash table.
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 3874381c4483ba7794ac2abf157e265546f9bfa7: [Backport #19759]</title>
<updated>2023-07-23T03:01:21+00:00</updated>
<author>
<name>nagachika</name>
<email>nagachika@ruby-lang.org</email>
</author>
<published>2023-07-23T03:01:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=3354aacb73c65420a10cb41c0696e62dd1ba279b'/>
<id>3354aacb73c65420a10cb41c0696e62dd1ba279b</id>
<content type='text'>
	Fix autosplat conditions to handle ruby2_keywords case

	Autosplat should not occur if there are two arguments but second
	argument is an array containing a ruby2_keywords splat. Only
	autosplat if a single argument to be yielded to the block, and there
	is no splatted flagged keyword hash passed.

	Fixes [Bug #19759]
	---
	 test/ruby/test_proc.rb | 26 ++++++++++++++++++++++++++
	 vm_args.c              |  3 ++-
	 2 files changed, 28 insertions(+), 1 deletion(-)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	Fix autosplat conditions to handle ruby2_keywords case

	Autosplat should not occur if there are two arguments but second
	argument is an array containing a ruby2_keywords splat. Only
	autosplat if a single argument to be yielded to the block, and there
	is no splatted flagged keyword hash passed.

	Fixes [Bug #19759]
	---
	 test/ruby/test_proc.rb | 26 ++++++++++++++++++++++++++
	 vm_args.c              |  3 ++-
	 2 files changed, 28 insertions(+), 1 deletion(-)
</pre>
</div>
</content>
</entry>
<entry>
<title>Raise RuntimeError if Kernel#binding is called from a non-Ruby frame</title>
<updated>2022-04-07T02:14:03+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2022-04-07T02:14:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=0b091fdac6ceb33b7379ceddc9a49a79d0e158b2'/>
<id>0b091fdac6ceb33b7379ceddc9a49a79d0e158b2</id>
<content type='text'>
Check whether the current or previous frame is a Ruby frame in
call_trace_func and rb_tracearg_binding before attempting to
create a binding for the frame.

Fixes [Bug #18487]

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>
Check whether the current or previous frame is a Ruby frame in
call_trace_func and rb_tracearg_binding before attempting to
create a binding for the frame.

Fixes [Bug #18487]

Co-authored-by: Alan Wu &lt;XrXr@users.noreply.github.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "Raise RuntimeError if Kernel#binding is called from a non-Ruby frame"</title>
<updated>2022-04-01T14:22:49+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2022-04-01T14:22:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d1d48cb690fdad855da94b2a2d11721428bc06ba'/>
<id>d1d48cb690fdad855da94b2a2d11721428bc06ba</id>
<content type='text'>
This reverts commit 343ea9967e4a6b279eed6bd8e81ad0bdc747f254.

This causes an assertion failure with -DRUBY_DEBUG=1 -DRGENGC_CHECK_MODE=2
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 343ea9967e4a6b279eed6bd8e81ad0bdc747f254.

This causes an assertion failure with -DRUBY_DEBUG=1 -DRGENGC_CHECK_MODE=2
</pre>
</div>
</content>
</entry>
<entry>
<title>Do not autosplat array in block call just because keywords accepted</title>
<updated>2022-03-30T18:03:56+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2022-03-30T18:03:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=fbaadd1cfe7fbfd1b904f193f99d7c845a6ed804'/>
<id>fbaadd1cfe7fbfd1b904f193f99d7c845a6ed804</id>
<content type='text'>
If the block only accepts a single positional argument plus keywords,
then do not autosplat.  Still autosplat if the block accepts more
than one positional argument in addition to keywords.

Autosplatting a single positional argument plus keywords made sense
in Ruby 2, since a final positional hash could be used as keywords,
but it does not make sense in Ruby 3.

Fixes [Bug #18633]</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If the block only accepts a single positional argument plus keywords,
then do not autosplat.  Still autosplat if the block accepts more
than one positional argument in addition to keywords.

Autosplatting a single positional argument plus keywords made sense
in Ruby 2, since a final positional hash could be used as keywords,
but it does not make sense in Ruby 3.

Fixes [Bug #18633]</pre>
</div>
</content>
</entry>
<entry>
<title>Raise RuntimeError if Kernel#binding is called from a non-Ruby frame</title>
<updated>2022-03-24T19:31:07+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2022-02-17T18:24:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=343ea9967e4a6b279eed6bd8e81ad0bdc747f254'/>
<id>343ea9967e4a6b279eed6bd8e81ad0bdc747f254</id>
<content type='text'>
Check whether the current or previous frame is a Ruby frame in
call_trace_func before attempting to create a binding for the frame.

Fixes [Bug #18487]

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>
Check whether the current or previous frame is a Ruby frame in
call_trace_func before attempting to create a binding for the frame.

Fixes [Bug #18487]

Co-authored-by: Alan Wu &lt;XrXr@users.noreply.github.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Make Proc#parameters support lambda keyword for returning parameters as if lambda</title>
<updated>2022-03-17T18:52:02+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2019-08-28T01:38:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b6804d62f822237e136e698e006c913df9990ec2'/>
<id>b6804d62f822237e136e698e006c913df9990ec2</id>
<content type='text'>
This makes it easier to use Proc#parameters to build wrappers.

Implements [Feature #15357]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This makes it easier to use Proc#parameters to build wrappers.

Implements [Feature #15357]
</pre>
</div>
</content>
</entry>
<entry>
<title>T#dup (T &lt; Proc) should return T's object</title>
<updated>2022-01-13T08:43:14+00:00</updated>
<author>
<name>Koichi Sasada</name>
<email>ko1@atdot.net</email>
</author>
<published>2021-02-18T08:10:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=7e21b77dc6bfefaf331a0dbf89782303b8cda05d'/>
<id>7e21b77dc6bfefaf331a0dbf89782303b8cda05d</id>
<content type='text'>
T#dup (T &lt; Proc) returns Proc object (not T) from Ruby 1.9.
[Bug #17545]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
T#dup (T &lt; Proc) returns Proc object (not T) from Ruby 1.9.
[Bug #17545]
</pre>
</div>
</content>
</entry>
<entry>
<title>Add support for anonymous rest and keyword rest argument forwarding</title>
<updated>2021-12-30T22:37:42+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2021-11-19T17:38:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=f53dfab95c30e222f67e610234f63d3e9189234d'/>
<id>f53dfab95c30e222f67e610234f63d3e9189234d</id>
<content type='text'>
This allows for the following syntax:

```ruby
def foo(*)
  bar(*)
end
def baz(**)
  quux(**)
end
```

This is a natural addition after the introduction of anonymous
block forwarding.  Anonymous rest and keyword rest arguments were
already supported in method parameters, this just allows them to
be used as arguments to other methods.  The same advantages of
anonymous block forwarding apply to rest and keyword rest argument
forwarding.

This has some minor changes to #parameters output.  Now, instead
of `[:rest], [:keyrest]`, you get `[:rest, :*], [:keyrest, :**]`.
These were already used for `...` forwarding, so I think it makes
it more consistent to include them in other cases.  If we want to
use `[:rest], [:keyrest]` in both cases, that is also possible.

I don't think the previous behavior of `[:rest], [:keyrest]` in
the non-... case and `[:rest, :*], [:keyrest, :**]` in the ...
case makes sense, but if we did want that behavior, we'll have to
make more substantial changes, such as using a different ID in the
... forwarding case.

Implements [Feature #18351]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This allows for the following syntax:

```ruby
def foo(*)
  bar(*)
end
def baz(**)
  quux(**)
end
```

This is a natural addition after the introduction of anonymous
block forwarding.  Anonymous rest and keyword rest arguments were
already supported in method parameters, this just allows them to
be used as arguments to other methods.  The same advantages of
anonymous block forwarding apply to rest and keyword rest argument
forwarding.

This has some minor changes to #parameters output.  Now, instead
of `[:rest], [:keyrest]`, you get `[:rest, :*], [:keyrest, :**]`.
These were already used for `...` forwarding, so I think it makes
it more consistent to include them in other cases.  If we want to
use `[:rest], [:keyrest]` in both cases, that is also possible.

I don't think the previous behavior of `[:rest], [:keyrest]` in
the non-... case and `[:rest, :*], [:keyrest, :**]` in the ...
case makes sense, but if we did want that behavior, we'll have to
make more substantial changes, such as using a different ID in the
... forwarding case.

Implements [Feature #18351]
</pre>
</div>
</content>
</entry>
<entry>
<title>Preserve the encoding of message from outer local variables</title>
<updated>2021-10-29T09:53:57+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2021-10-29T08:34:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ec2e04c90d96541502c9b96e66900b4bb01676bb'/>
<id>ec2e04c90d96541502c9b96e66900b4bb01676bb</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
