From: Dave Thomas Date: 2001-01-04T06:09:45+09:00 Subject: [ruby-talk:8595] Re: bug?? "Joseph McDonald" writes: > Are you talking about automatic instantiation of a variable > as non-nil when an assignment happens? If so, I would also > like to see the same for FixNums and Strings. i.e.: > > x += 1; One of the problems with this is the data type issue. x += 1 is effectively x = x + 1 which is x = x.+(1) (that is, invoke the '+' method on the object referenced by the variable 'x'). Now, the problem is that Ruby has no idea what you were expecting 'x' to be if it has never been assigned to before. It _could_ assume that it's the type of its operand, but that'd be a WAG. Would that heuristic always produce the desired result? Dave