From: Yehuda Katz Date: 2011-12-03T04:20:57+09:00 Subject: [ruby-core:41454] Re: [ruby-trunk - Bug #5694] Proc#arity doesn't take optional arguments into account. --0016e64f5e0a44ff3204b320dea6 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Yeah=85 it would be nice to be able to do: if proc.arity_range.include?(2) if method.arity_range.include?(2) Yehuda Katz (ph) 718.877.1325 On Fri, Dec 2, 2011 at 12:33 AM, Trans wrote: > On Thu, Dec 1, 2011 at 11:13 PM, Yehuda Katz wrote: > > You could probably extract the information from #parameters, yeah. > > However, having the range is going to be more readily useful in the > cases where arity normally comes into play. Having to parse out this > information from parameters wouldn't be as clean except in the > simplest case. > > --0016e64f5e0a44ff3204b320dea6 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Yeah=85 it would be nice to be able to do:

=A0 if proc.a= rity_range.include?(2)
=A0 if method.arity_range.include?(2)

Yehuda Katz
(ph) 718.877.1325


On Fri, Dec 2, 2011 at 12:33 AM, Trans <= span dir=3D"ltr"><transfire@gmail= .com> wrote:
On Thu, Dec 1, 2011 at 11:13 PM, Yehuda Katz <wycats@gmail.com> wrote:
> You could probably extract the information from #parameters, yeah.

However, having the range is going to be more readily useful in the cases where arity normally comes into play. Having to parse out this
information from parameters wouldn't be as clean except in the
simplest case.


--0016e64f5e0a44ff3204b320dea6--