From: Florian Gross Date: 2005-01-09T17:26:23+09:00 Subject: Re: Type inference in ruby Trevor Andrade wrote: > def foo(object) > > return object.call(9, 7, 3) > > end > couldn't the type system figure out that object must respond to the call > command and thus eliminate an error like: > > foo(5) class Fixnum def call(*args) end end Note that Ruby could not even insert a check at the beginning of the method as another Thread might dynamically define Fixnum#call. > I guess I am also wondering about a lot of other things like why do you need > multiple assignment in Ruby? There doesn't seem to be any need for it since > you can just modify an object by sending it a message eg x = x + 1 is the > same as x.+(1). I don't see the connection between the two and you are not even doing multiple assignment in your example. Fixnum#+ does not modify the original receiver. It returns the result as a new Object. There are in place modifications in Ruby (String#gsub! etc.), but that has nothing to do with multiple assignment.