From: Austin Ziegler Date: 2003-03-22T04:59:29+09:00 Subject: Re: Proposal: new operator: '<-' (for assignments) On Fri, 21 Mar 2003 11:20:27 +0900, Phil Tomson wrote: > Since we can't override '=' (and it's a good idea that we can't) > it seems that it would be nice to have another overridable > operator for assigning values in classes. So, I'm proposing that > we allow a new operator '<-' (less-than minus) which can be > overridden to allow assignment, for example: I'm still not enamoured of the concept of using this instead of a #replace method, but what about "<:" instead? class Foo def initialize(value) @val = value end def <:(newVal) @val = newVal end end foo = Foo.new("this value") # .....later... foo <: "some new value" -austin -- Austin Ziegler, austin@halostatue.ca on 2003.03.21 at 14:56:27