Will Ruby2 support required keyword argument? AFAIR, Python doesn’t:
def foo(a, b=2):
…
foo(a=1) # ok
foo(a=1, b=2) # ok
and Perl6 will:
sub foo(+$a is required, +$b is required) {
…
}
note: i’m not sure about the exact P6 syntax for calling
foo(a: 1); # error!
foo(a: 1, b: 2) # ok
This is being discussed at perl6-language list right now. I also believe
with the poster that basically said required keyword argument is
essential for a “proper” keyword-based API.
Also, implementation-wise, will the introduction of keyword arguments in
Ruby2 bring a performance hit to all method calls, including positional
arguments? (I.e., will normal/positional argument calls in Ruby2 be
slower than Ruby1?)
···
–
dave