From: ptkwt@... (Phil Tomson) Date: 2004-04-10T02:24:25+09:00 Subject: Re: Would a ':=' operator break anything? In article <1081496723.176610.19491.nullmailer@picachu.netlab.jp>, Yukihiro Matsumoto wrote: >Hi, > >In message "Would a ':=' operator break anything?" > on 04/04/09, Phil Tomson writes: > >|Would allowing for overloading a ':=' operator break anything? (seems kind >|of Pascalish :) > >|So the ':=' operator 'looks' close enough to assignment so that the >|meaning is clear and it keeps me from having to do: >| >| b.assign 42 >| >|Which is how I do it currently with this class and several other classes >|I've come up with over the years. >| >|So how about it, would allowing a ':=' operator break anything? > >The point is what you want is not assignment in Ruby. It might cause >confusion that naming ":=" something which is not an assignment. >Besides that, I may use ":=" for something different in the future, >although I have no plan now (I had thought to use it once). > > matz. Yes, it would require education. I know I personally have several classes where I have an 'assign' method: someobj.assign value I know that 'assign' is not actually doing the same thing as '=', but it is changing some important attribute of someobj. Phil