From: Philipp Meier Date: 2002-09-13T04:19:50+09:00 Subject: Re: General ?s about a couple of Ruby features --dkEUBIird37B8yKS Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Sep 13, 2002 at 03:20:35AM +0900, Andrew K wrote: >=20 > "Matt Gushee" wrote in message > news:20020912172550.GB910@swordfish... > > * The ability to modify existing class and module definitions is > > obviously interesting, but what is it *useful* for? I can see > > that this feature allows you to change the behavior of all instances > > of a class; what, if any, other benefits are there? Does anyone have > > some real-world application scenarios where this feature is useful? > > >=20 > I'm relatively new to the language as well, but doesn't this feature make= it > extremely easy to add methods to existing Ruby types for example? That > usage would seem to be pretty common to me. attr_reader and attr_write use the dynamic declaration of methods e.g. And Date defines a method :once which make a method cache some internal calculation. -billy. --=20 Meisterbohne S=F6flinger Stra=DFe 100 Tel: +49-731-399 499-0 eL=F6sungen 89077 Ulm Fax: +49-731-399 499-9 --dkEUBIird37B8yKS Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE9gOj4fBriNoqItSYRAuKLAJ470y9ETSGNa58t/0wV5Ke5ok/mrwCdF3d0 x6gzfx0sBGv7pvRPtIBSA94= =KdRU -----END PGP SIGNATURE----- --dkEUBIird37B8yKS--