From: Yehuda Katz Date: 2008-11-26T09:28:06+09:00 Subject: [ruby-core:20107] Re: Proposal: Method#get_args ------=_Part_658_15638240.1227659566010 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline It doesn't let me do 100% of what I want, but it does enough for me to be happy. :-D I'll +1 the patch -- Yehuda On Tue, Nov 25, 2008 at 1:13 AM, Yukihiro Matsumoto wrote: > Hi, > > In message "Re: [ruby-core:20029] Re: Proposal: Method#get_args" > on Sat, 22 Nov 2008 05:31:09 +0900, "Yehuda Katz" > writes: > | > |[1 ] > |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. > > -- Yehuda Katz Developer | Engine Yard (ph) 718.877.1325 ------=_Part_658_15638240.1227659566010 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline It doesn't let me do 100% of what I want, but it does enough for me to be happy.

:-D

I'll +1 the patch

-- Yehuda

On Tue, Nov 25, 2008 at 1:13 AM, Yukihiro Matsumoto <matz@ruby-lang.org> wrote:
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.




--
Yehuda Katz
Developer | Engine Yard
(ph) 718.877.1325
------=_Part_658_15638240.1227659566010--