On Thu, 15 Feb 2001, Dave Thomas wrote:

> matz / zetabits.com (Yukihiro Matsumoto) writes:
> 
> > Possible.  The key is here.
> > 
> > |a.at(0)   -> 1 # maybe change to [1]?
> > 
> > For consistency, at(0) might be better to return an array, but it's
> > incompatibility, which I don't want to incorporate.

Having the single index return a single value, and multiple ones return
an array, is in keeping with the behavior of #[], so in that sense it
would be consistent.

> > Array#elements? Hash#values?
> 
> I _think_ I'd prefer #elements_at and #values_at, but I'm not sure.

I like #elements_at for Array, but possibly #values_for for #Hash.
I think of a hash as having a value "for" (rather than "at") a given key.


David

-- 
David Alan Black
home: dblack / candle.superlink.net
work: blackdav / shu.edu
Web:  http://pirate.shu.edu/~blackdav