From: "David A. Black" Date: 2003-12-19T22:28:49+09:00 Subject: Re: How to return more than one result from a method? Hi -- On Fri, 19 Dec 2003, Robert Klemme wrote: > > "David A. Black" schrieb im Newsbeitrag > news:Pine.LNX.4.44.0312181612570.29763-100000@wobblini... > > irb(main):001:0> def two; return 1,2; end > > => nil > > irb(main):002:0> a,b = two > > => [1, 2] > > irb(main):003:0> a > > => 1 > > irb(main):004:0> b > > => 2 > > > > That might be the best way if you don't need to deal with the two > > values as a pair beyond getting them back from the method. > > Even if you need to deal with them as pair this is the appropriate method: Do you mean: even if you don't need to deal... ? > irb(main):001:0> def two; return 1,2; end > => nil > irb(main):002:0> all = two > => [1, 2] > irb(main):003:0> I'm not sure what you mean by appropriate. Can you elaborate? David -- David A. Black dblack@wobblini.net