From: ahoward Date: 2003-06-18T06:07:50+09:00 Subject: Re: [RCR] Array#push(empty array expanded) => no exception On Wed, 18 Jun 2003, Hal E. Fulton wrote: > If you think about it, it makes sense. mostly. > For one thing, what if a variable is passed in? We don't want it to fail > just because the array is empty. well this is not *exactly* the case simon described though is it? method [] # empty array as arg method *[] # NO args! so, it's not that the method is failing just because an empty array is passed in, it is failing because an empty array was exploded, yielding and non-existent parameter list. i may be in the minority, but it's not THAT counter intuitive for me that attempting to call a method expecting args, with no args, should be an error. > For another thing, consider what happens with > strings. foo = "value" + "" should not be > illegal, I think. no, of course not. but this is analogous to the first example above, not the second one, which would be more along the lines of foo = "value" + *"" if '*String' did, for example, an explosion into a list of Fixnums (chars) or something like that... -a -- ==================================== | Ara Howard | NOAA Forecast Systems Laboratory | Information and Technology Services | Data Systems Group | R/FST 325 Broadway | Boulder, CO 80305-3328 | Email: ara.t.howard@noaa.gov | Phone: 303-497-7238 | Fax: 303-497-7259 | ~ > ruby -e 'p(%.\x2d\x29..intern)' ====================================