Re: I'm confused about Ruby.2.5.3 Method#arity for Dir.entries and Dir#entries
gga <[email protected]> Tue, 22 Oct 2019 09:14:49 -0300
| Newsgroups | gmane.comp.lang.ruby.general |
|---|---|
| Message-ID | <[email protected]> |
El 7/10/19 a las 10:53, Colin Bartlett escribió:
> Method#arity:
> Returns an indication of the number of arguments accepted by a method.
> Returns a nonnegative integer for methods that take a fixed number of arguments.
> For Ruby methods that take a variable number of arguments,
> returns -n-1, where n is the number of required arguments. ...
>
> In the following:
> 1. Why isn't MRI Dir.method(:entries).arity == 1?
> 2. Why isn't JRuby Dir.method(:entries).arity == -2?
> 3. Why isn't MRI d.method(:entries).arity == 0? (Where d = Dir.new(".").)
>
> Thanks in advance for any help!
Looks like a couple of bugs to me.
Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>