From: "Hal E. Fulton" Date: 2003-01-11T05:15:51+09:00 Subject: Re: dot-equals method? ----- Original Message ----- From: "Chris Pine" To: "ruby-talk ML" Sent: Friday, January 10, 2003 2:05 PM Subject: dot-equals method? > Hello, > > I keep finding myself wanting to write things like this: > > string.=reverse > input.=split /\s*/ > > instead of this: > > string = string.reverse > input = input.split /\s*/ I understand. But in these two cases I guess you'd want reverse! and split! instead. > It's a silly thing, I guess, but after years of programming in Ruby I > *still* find myself trying to do this... so maybe there's something to this. > > Is there a good reason why this couldn't be done? (Does it break some > syntax somewhere, or just not make sense?) Would it be possible to do > something like this without hacking the interpreter? I've thought about this before. I think you'd probably have to use a symbol for the method, to distinguish from a toplevel method call or self.meth, but then the parameters wouldn't make sense. All in all, I think it would cause more trouble than it helped us. Just my opinion. Hal