From: Austin Ziegler Date: 2002-11-08T08:59:59+09:00 Subject: Re: v.polar = rho, theta On Fri, 8 Nov 2002 06:27:07 +0900, Paul Brannan wrote: > On Fri, Nov 08, 2002 at 06:09:17AM +0900, Hans Fugal wrote: >> But it struck me that defining polar=(rho,theta) would be more >> ruby-like, and I expected to call it like so: v.polar = 1, 3.14 >> That doesn't work, though. > Is there a reason why Ruby doesn't treat this case like like it > treats multiple assignment to a variable? It is slightly odd -- but if polar=(rho, theta) were changed to polar=(*rhotheta), then it would work as expected. class VPtest def polar=(*a) p a.flatten end def initialize; end end v = VPtest.new v.polar = 5, 6 -austin -- Austin Ziegler, austin@halostatue.ca on 2002.11.07 at 18.48.46