From: David Alan Black Date: 2002-05-12T21:37:50+09:00 Subject: Re: cgi params api Hello -- On Sun, 12 May 2002, Dossy wrote: > On 2002.05.12, Sean Chittenden wrote: > > What's a better API: > > > > Suppose p['name'] has two values: > > > > p['name'] >> val1 # on second call, p['name'] will return a new value > > p['name'] >> val2 # in a round robin fashion > > > > or > > > > p['name'] >> ['val1','val2'] # if multiple vals per key > > p['name'] >> 'val1' # if only one val per key > > My two cents? > > p['name'] always returns val1. p['name'].to_a returns > the array of values. "to_a", to_me, suggests something being converted to an array. That's (arguably very) different from what you're describing, which is something like the head of the array vs. the whole array. It's like saying: 'val1'.to_a == ['val1', 'val2'] which I don't think makes sense. (I know you're talking about a particular case, not generally saying that strings should do that, but this is what I think it boils down to.) David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav