Hi,
In message "Re: MatchData#select rdoc and arity incorrect"
on Thu, 11 Oct 2007 16:07:28 +0900, Charles Oliver Nutter <charles.nutter / sun.com> writes:
|Rdoc is here:
|
|~/NetBeansProjects/jruby $ ri MatchData#select
|------------------------------------------------------- MatchData#select
| mtch.select([index]*) => array
|------------------------------------------------------------------------
| Uses each _index_ to access the matching values, returning an array
| of the corresponding matches.
|
| m = /(.)(.)(\d+)(\d)/.match("THX1138: The Movie")
| m.to_a #=> ["HX1138", "H", "X", "113", "8"]
| m.select(0, 2, -2) #=> ["HX1138", "X", "113"]
|
|But the example given doesn't run, and the arity of select is -1 instead
|of zero as would be indicated by the resulting error.
The code was wrong. Perhaps I was confusing MatchData to provide
Enumerable when I fix Hash#select etc. I will fix this, and make
select alias to values_at.
matz.