From: Russell Norris Date: 2007-09-04T21:24:20+09:00 Subject: Re: assigning to hash keys when there is a default value? Ahhh now I see what you kittens are seeing. I _still_ don't think it'sa bug though. || might be a no-brainer but ||= isn't completelyanalogous to methods like += since || itself isn't a method though itis an operator. || always returns either/or. And in this case, Ireally think the operator is doing the expected behavior even if the= might be a misleading analogy. Also, I didn't mean that I learned from experience but that it was theway I was taught this. In case that makes a difference. I dunno. Finally, I musta missed something else 'cause x += 1 [unless x isn'tnumeric to begin with] _always_ increments and you said that it mightnot always do so. Apologies if I've missed some joke or something. :) RSL On 9/3/07, Pe単a, Botp wrote:> From: sconds@gmail.com [mailto:sconds@gmail.com] On Behalf Of Russell Norris:> # I learned that x ||= y means set x to y unless x, so I don't see the>> there's the bug: you've changed the meaning of x ||= y, or of foo=bar for that matter.>> # bug. and i don't see this as being at all unpredictable.>> you just said you've _learned that x||=y means set x to y unless x. Surely it was _unpredictable at some point. Surely x=y is a no-brainer for a many of us :)>> and now we all have to update our test cases, cause maybe x += 1 may not always be x = x + 1>> speaking of least surprise :(>> kind regards -botp>>>>