On 3/2/07, Gary Wright <gwtmp01 / mac.com> wrote:
>
> On Mar 2, 2007, at 7:54 AM, Leslie Viljoen wrote:
> > Is it *really* a problem that strings and integers produce values that
> > your method would make use of? Say someone wants to encode those input
> > parameters into a string - as long as [] works, they can. Why is this
> > a problem?
>
> As a general response, I'd say that there is a strong semantic
> difference between objects that store key/value pairs (Hash,
> OrderedHash,
> RBTree, etc.) and objects that aren't general collections but do
> have some sort of indexing features (Integers, Strings).  Arrays are
> sort of in the middle.

But why does the difference matter? Are you going to be using the
parameters to your function in a way that would make Arrays or Strings
throw exceptions? Then you would need to create some sort of test for
that usage.

Otherwise, why restrict the user of your method this way?