James Edward Gray II wrote: > On Jan 2, 2006, at 2:08 PM, Hal Fulton wrote: > >> Chad Perrin wrote: >> >>> On Tue, Jan 03, 2006 at 12:03:03AM +0900, James Edward Gray II wrote: >>> >>>> On Jan 2, 2006, at 2:29 AM, Chad Perrin wrote: >>>> >>>> >>>>> In particular, you could have an array called myarray >>>>> (for example) and iterate over its contents using the each method to >>>>> perform the same action on each element of the array: >>>>> >>>>> myarray.each do { |foo| puts foo } >>>> >>>> >>>> Only we would never write that since the following does the same >>>> thing: >>>> >>>> puts myarray >>> >>> Well . . . true. >>> This is why I don't teach programming. >> >> >> Actually, I think there's a difference in behavior >> if you try them both. > > > Other than the return value? Well, I'm quite wrong. I thought that 'puts myarray' would print on a single line with elements scrunched together. Maybe this was true in the past? Of course, I *could* pretend I was talking about the extraneous 'do' in 'myarray.each do { |foo| puts foo }' ... but I wasm't. ;) Hal