From: "Mikael Høilund" Date: 2008-04-26T06:22:34+09:00 Subject: Re: How to return more than one object to a block On Apr 25, 2008, at 22:54, Mikael Høilund wrote: > > On Apr 25, 2008, at 20:43, Ivan V. wrote: > >> Here's a more clean explanation: >> >> def dothis >> yield >> end >> >> x = dothis() { >> 'this' >> 'that' >> } >> >> How do I make 'x' be an array holding both the strings. Of course I >> can >> just make those strings into an array, but I want to do it from the >> dothis method. > > x = dothis() { > ['this', 'that'] > } > > should do it. > Sorry, I seem to have mis-read your initial question. In order to do what you asked, you would have to make them an array, though (unless some of the plans for Ruby 1.9 are realized, which I sincerely hope they are not). Maybe if you give a use-case, I could be a little more helpful, though.