mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
3b302ea8c9
This approach uses a flag bit on the final hash object in the regular splat, as opposed to a previous approach that used a VM frame flag. The hash flag approach is less invasive, and handles some cases that the VM frame flag approach does not, such as saving the argument splat array and splatting it later: ruby2_keywords def foo(*args) @args = args bar end def bar baz(*@args) end def baz(*args, **kw) [args, kw] end foo(a:1) #=> [[], {a: 1}] foo({a: 1}, **{}) #=> [[{a: 1}], {}] foo({a: 1}) #=> 2.7: [[], {a: 1}] # and warning foo({a: 1}) #=> 3.0: [[{a: 1}], {}] It doesn't handle some cases that the VM frame flag handles, such as when the final hash object is replaced using Hash#merge, but those cases are probably less common and are unlikely to properly support keyword argument separation. Use ruby2_keywords to handle argument delegation in the delegate library. |
||
---|---|---|
.. | ||
bundler | ||
cgi | ||
csv | ||
drb | ||
e2mmap | ||
fileutils | ||
forwardable | ||
irb | ||
logger | ||
matrix | ||
net | ||
optparse | ||
racc | ||
rdoc | ||
reline | ||
rexml | ||
rinda | ||
rss | ||
rubygems | ||
tracer | ||
unicode_normalize | ||
uri | ||
webrick | ||
yaml | ||
.document | ||
abbrev.rb | ||
base64.rb | ||
benchmark.rb | ||
bundler.rb | ||
cgi.rb | ||
csv.rb | ||
debug.rb | ||
delegate.rb | ||
drb.rb | ||
e2mmap.rb | ||
English.rb | ||
erb.rb | ||
fileutils.rb | ||
find.rb | ||
forwardable.rb | ||
getoptlong.rb | ||
ipaddr.gemspec | ||
ipaddr.rb | ||
irb.rb | ||
logger.rb | ||
matrix.rb | ||
mkmf.rb | ||
monitor.rb | ||
mutex_m.gemspec | ||
mutex_m.rb | ||
observer.rb | ||
open-uri.rb | ||
open3.rb | ||
optionparser.rb | ||
optparse.rb | ||
ostruct.gemspec | ||
ostruct.rb | ||
pp.rb | ||
prettyprint.rb | ||
prime.gemspec | ||
prime.rb | ||
pstore.rb | ||
racc.rb | ||
rdoc.rb | ||
readline.rb | ||
reline.rb | ||
resolv-replace.rb | ||
resolv.rb | ||
rss.rb | ||
rubygems.rb | ||
securerandom.rb | ||
set.rb | ||
shellwords.rb | ||
singleton.rb | ||
tempfile.rb | ||
time.rb | ||
timeout.rb | ||
tmpdir.rb | ||
tracer.rb | ||
tsort.rb | ||
un.rb | ||
uri.rb | ||
weakref.rb | ||
webrick.rb | ||
yaml.rb |