<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/doc/syntax/methods.rdoc, branch v3_4_9</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<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>Anonymous block forwarding allows a method to forward a passed</title>
<updated>2021-11-18T22:17:57+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2021-11-18T20:44:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=4adb012926f8bd6011168327d8832cf19976de40'/>
<id>4adb012926f8bd6011168327d8832cf19976de40</id>
<content type='text'>
block to another method without having to provide a name for the
block parameter.

Implements [Feature #11256]

Co-authored-by: Yusuke Endoh mame@ruby-lang.org
Co-authored-by: Nobuyoshi Nakada nobu@ruby-lang.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
block to another method without having to provide a name for the
block parameter.

Implements [Feature #11256]

Co-authored-by: Yusuke Endoh mame@ruby-lang.org
Co-authored-by: Nobuyoshi Nakada nobu@ruby-lang.org
</pre>
</div>
</content>
</entry>
<entry>
<title>Update keyword argument description in method syntax guide</title>
<updated>2021-05-11T22:45:52+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2021-05-11T22:45:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ee1725cecb1c87ec10a8962ef8317610c5f989e4'/>
<id>ee1725cecb1c87ec10a8962ef8317610c5f989e4</id>
<content type='text'>
Remove discussion of Ruby 2.7 specific handling of keyword
argument separation.  Add a small example of keyword to
positional hash conversion for methods not accepting
keyword arguments.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove discussion of Ruby 2.7 specific handling of keyword
argument separation.  Add a small example of keyword to
positional hash conversion for methods not accepting
keyword arguments.
</pre>
</div>
</content>
</entry>
<entry>
<title>[Doc] Fix a typo s/invokations/invocations/</title>
<updated>2021-04-25T07:45:01+00:00</updated>
<author>
<name>wonda-tea-coffee</name>
<email>rikita.ishikawa@crowdworks.co.jp</email>
</author>
<published>2021-04-25T05:02:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=fc84e6679d98ebb83a02609e8ba2f588e99565eb'/>
<id>fc84e6679d98ebb83a02609e8ba2f588e99565eb</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>methods.rdoc: Improve method definition documentation</title>
<updated>2020-12-26T09:40:52+00:00</updated>
<author>
<name>Marcus Stollsteimer</name>
<email>sto.mar@web.de</email>
</author>
<published>2020-12-26T09:40:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=3fc53de5c961cc8fa2b6acbd63874b89fe709520'/>
<id>3fc53de5c961cc8fa2b6acbd63874b89fe709520</id>
<content type='text'>
* typos, grammar, formatting
* use `concrete_method` again in `regular_method` example,
  to better distinguish from `forwarding_method` example
* clarify that leading arguments before `...` require Ruby 3.0
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* typos, grammar, formatting
* use `concrete_method` again in `regular_method` example,
  to better distinguish from `forwarding_method` example
* clarify that leading arguments before `...` require Ruby 3.0
</pre>
</div>
</content>
</entry>
<entry>
<title>methods.rdoc: Clarify "currently" means "in 2.7" here</title>
<updated>2020-12-26T09:40:47+00:00</updated>
<author>
<name>Marcus Stollsteimer</name>
<email>sto.mar@web.de</email>
</author>
<published>2020-12-26T09:40:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ce65a7687f1e05ce613483102a8131d8e827bcb6'/>
<id>ce65a7687f1e05ce613483102a8131d8e827bcb6</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Update method definition documentation</title>
<updated>2020-12-25T13:10:09+00:00</updated>
<author>
<name>zverok</name>
<email>zverok.offline@gmail.com</email>
</author>
<published>2020-12-24T09:06:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=255ee4de8ce8f1db044c04843bef25c78e2c28ac'/>
<id>255ee4de8ce8f1db044c04843bef25c78e2c28ac</id>
<content type='text'>
* Add endless methods
* Add argument forwarding ...
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Add endless methods
* Add argument forwarding ...
</pre>
</div>
</content>
</entry>
<entry>
<title>Adjusted the heading level of "Block Arguments" [ci skip]</title>
<updated>2020-12-25T13:09:22+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2020-12-25T13:05:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=aaf0474e76ecf8d8fc675c3e56a803d887e63965'/>
<id>aaf0474e76ecf8d8fc675c3e56a803d887e63965</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Update documentation for Array/Hash Argument section of methods.rdoc</title>
<updated>2020-01-17T10:50:39+00:00</updated>
<author>
<name>Adam Isom</name>
<email>adam.r.isom@gmail.com</email>
</author>
<published>2020-01-16T21:42:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=09271acdaf8816562c882780d45306b3155152a1'/>
<id>09271acdaf8816562c882780d45306b3155152a1</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[DOC] Fix typo</title>
<updated>2019-12-24T12:01:24+00:00</updated>
<author>
<name>Marcus Stollsteimer</name>
<email>sto.mar@web.de</email>
</author>
<published>2019-12-24T12:01:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=66e518f7b3e0bf307f86a51e6db02c3d1ec8df84'/>
<id>66e518f7b3e0bf307f86a51e6db02c3d1ec8df84</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
