From: Trans Date: 2005-03-24T12:44:51+09:00 Subject: Re: RCR 296: Destructive methods return self Florian Gross wrote: > result and changed. It assigns the keyword return value with that name > to the variable with that name. It might be very rarely needed, though. Ah, Okay. That makes sense. Though you are right it does look a bit odd, which is why I wasn't sure what you intended. I think as you said that might be a little too obscure. > I think the uncompressed syntax would be more useful. I agree. > > return ( arg1: value1, arg2: value2 ) > > > > Perhaps? Then how does one capture these values, which is what you're > > asking. Yes? Is the return value a hash now as opposed to an array? Or > > is it something different entirely? > > That looks nice. I think it would return a Hash. Okay, nice. That keeps things straight forward --no special type of return object involved. > My suggestion for capturing them is to introduce a new variable > assignment syntax: > > (x: var1, y: var2) = {x: 1, y: 2} > var1 # => 1 > var2 # => 2 > > This might look odd at first, but I think it makes some kind of sense... Yes, it does make sense. But also true to it seems a bit odd at first. I wonder, since this can already be done, as Matt pointed out: h = {x: 1, y: 2} var1, var2 = *h.values_at(:x, :y) Could the following simple notation ultimately be workable? var1, var2 = h[:x,:y] T.