Hi,
In message "Re: [ruby-core:20029] Re: Proposal: Method#get_args"
on Sat, 22 Nov 2008 05:31:09 +0900, "Yehuda Katz" <wycats / gmail.com> writes:
|
|[1 <text/plain; ISO-8859-1 (7bit)>]
|What values does simple_default handle? Assuming it covers the simple cases
|we discussed is this ready to apply? Are there any objections?
|-- Yehuda
The most realistic implementation is one from Nobu in
[ruby-core:19947], which ignores default values for optional
arguments.
p ->(a,b=1,c=4,d){}.parameters
# => [[:req, :a], [:opt, :b], [:opt, :c], [:req, :d]]
If it's OK, I will approve the patch. The only concern will be we
currently have no parameter information for C implemented methods with
variable argument.
p method(:printf).parameters
# => [[:rest]]
matz.