From: "Iñaki Baz Castillo" Date: 2008-04-08T06:25:07+09:00 Subject: Re: Method parameters Type El Lunes, 7 de Abril de 2008, Phillip Gawlowski escribió: > Avdi Grimm wrote: > | On Mon, Apr 7, 2008 at 4:28 PM, Mike Blackwell > > wrote: > |> Because, unlike Java, Ruby is not a strongly typed language. > | > | To be pedantic, both Java and Ruby are strongly typed. However, Java > | is statically types, and Ruby is dynamically typed. > > Ruby is? > > irb(main):001:0> t = String.new > => "" > irb(main):002:0> t.class > => String > irb(main):003:0> t = 1 > => 1 > irb(main):004:0> t.class > => Fixnum > irb(main):005:0> exit > > Doesn't look like it to me, since I can change the type of a variable > with ease. No, look at the following example: irb(main):001:0> text = "The number is: " => "The number is: " irb(main):002:0> number = 25 => 25 irb(main):003:0> puts text + number TypeError: can't convert Fixnum into String from (irb):3:in `+' from (irb):3 from :0 -- Iñaki Baz Castillo