From: patrick-may@... (Patrick May) Date: 2002-05-15T10:50:43+09:00 Subject: Re: cgi params api Dossy wrote in message news:<20020514172508.GJ14145@panoptic.com>... > On 2002.05.15, David Alan Black wrote: > > > > Personally I don't like it: it still feels to me like #to_a (on what > > at least "feels" like a string) is magically interpolating values that > > weren't there. This makes me question in what sense it is going "to" > > an array -- or, to put it another way, "to_a" seems like the wrong > > name for what is happening here. > > You're not dealing with a string. You're dealing with a Param, > that's like a String with (essentially) an Array mixed in. Mixin CGI::Param instead of subclassing String, don't walk over any String methods. Then the object is exactly what it is: a String with an Array mixed in. > Do you always feel uncomfortable subclassing String or Array, > or is it because you feel that a Param really wants to be > something else entirely? Not from a code-view perspective, > but from an object hierarchy perspective ... Using a mixin makes it easier to extend this metaphor to file uploads ~ Patrick