From: Eric Hodel Date: 2003-05-13T22:39:56-07:00 Subject: Re: Ruby OO? sin method? puts method? @@? --9/eUdp+dLtKXvemk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable KONTRA Gergely (kgergely@mlabdial.hit.bme.hu) wrote: > On 0513, nobu.nokada@softhome.net wrote: > > > Than why not sin is a method? > > To fit to mathematical notation. > ??? > I write sin(0.5) but also abs(0.5) > So I don't know why the difference, and why cannot a number tell it's > sin. This is analogous to "asdf".length and the others... class Numeric def sin Math.sin(self) end def puts(io =3D $stdout) io.puts self end end (Math::PI/2).sin.puts # =3D> 1.0 In Ruby, its easy enough to change things about. --=20 Eric Hodel - drbrain@segment7.net - http://segment7.net All messages signed with fingerprint: FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04 --9/eUdp+dLtKXvemk Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE+wdasMypVHHlsnwQRAg+GAKDKFtwaOP+GoJ3fnoxGF8UPOMjgVACePjnA mjAD5ls9txZ7LCTVoHVu/V4= =/2jV -----END PGP SIGNATURE----- --9/eUdp+dLtKXvemk--