David Alan Black <dblack / candle.superlink.net> wrote in message news:<Pine.LNX.4.30.0205121112470.26952-100000 / candle.superlink.net>...
> An array seems to me like a more natural container for multiple values
> than a string.  I guess I'm not sure what you would ever do with such
> a string, except split it on $/ and get an array :-)

Array is the more natural container for multiple values than a string.
 A string is the more natural container for a single value.

However, given a form, the programmer can safely assumptions,
including:

+ the meaning of different param keys
+ whether a param should be treated as having single or multiple
values

Dealing with unexpected input is usually done in the form of sanity
checking asserts.  Once the input differs from the 'contract' of the
form, the correct behavior is usually to fail.  After the asserts, the
programmer controls how s/he wants to treat the data.

This change would make using a singular param easier.  In my
experience, this is the common case by a long shot.

# -- now --
# confusing ways to get a single value
name, = cgi["name"]
name = cgi["name"].to_s
name = cgi["name"][0]
name = cgi["name"].join("/0")

# quick way to get multiple values
multiple = cgi["hobbies]

# -- future --
# quick way to get single value
name = cgi["name"]

# longer, but still quick way to get multiple values
multiple = cgi["hobbies"].values

~ Patrick