From: Phillip Gawlowski Date: 2008-04-08T07:53:00+09:00 Subject: Re: Method parameters Type -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Avdi Grimm wrote: | On Mon, Apr 7, 2008 at 5:12 PM, Phillip Gawlowski | wrote: |> Ruby is? |> |> Doesn't look like it to me, since I can change the type of a variable |> with ease. | | You're confusing static typing and strong typing. | | In a weakly-typed language, like C, it is possible to cast an integer | as a, for instance, a char*, and then call string functions like | sprintf() on it and the compiler will compile it, the runtime will run | it, and it will wreak whatever havoc you please. Most high-level | languages are strongly-typed, these days - neither Java or Ruby will | allow you to call a String method on an Integer. You can assign | whatever object you want to a variable in Ruby - hence *dynamic* | typing - but that object will only ever allow you to call supported | methods on it; otherwise you'll get a NoMethodError. Hence *strong* | typing. | Thanks for the enlightenment. :) - -- Phillip Gawlowski Twitter: twitter.com/cynicalryan Zmodem has bigger bits, softer blocks, and tighter ASCII. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkf6pcwACgkQbtAgaoJTgL9trwCghb7DYangJvsq/ktpceHh12FD 004AnikbmUhG0gwWUJywu43qfbPa76sK =b6S6 -----END PGP SIGNATURE-----