From: Hal Fulton Date: 2004-04-09T22:51:27+09:00 Subject: Re: Would a ':=' operator break anything? Yukihiro Matsumoto wrote: > |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). I think I see his point, however. I will make these comments: 1. I view his := as a kind of limited assignment. 2. It would fully change the state of the object, but would not change the class or object id. 3. In that sense, it would be like a synonym for #replace on Arrays and Strings: str := "hello" # same as str.replace("hello") arr := [1,2,3] # ... 4. Of course, this is problematic for Fixnums (etc.), as they are immediate values and are not mutable. Just a few thoughts. Hal