--sm4nu43k4a2Rpi4c Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable EbFFA: > I was playing with Ruby and wrote an interesting method: > def double n > n.object_id - 1 > end > Anyone know why this works? Why Ruby was implemented this way? Note that other Ruby implementations (JRuby, Rubinius, IronRuby do not have to keep this contract; it best considered as MRI peculiarity. But yes, I do find this design beautiful as well as Ruby¡Çs method lookup: http://www.viddler.com/explore/CobyR/videos/1/ ¡½ Shot -- It is absurd to have a hard and fast rule about what one should read and what one shouldn¡Çt. More than half of modern culture depends on what one shouldn¡Çt read. [Oscar Wilde, The Importance of Being Earnest] --sm4nu43k4a2Rpi4c Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkqVtYEACgkQi/mCfdEo8UocTACfWONFO3O5Y94YvjgR/k06e4Px ASAAn3IxU0bLhYB5U2RpMlebyw5feJlm n -----END PGP SIGNATURE----- --sm4nu43k4a2Rpi4c--