--UlVJffcvxoiEqYs2 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 29, 2011 at 12:26:58AM +0900, Roger Braun wrote: > 2011/4/28 Chad Perrin <code / apotheon.net>: > > > > For my purposes at least, it seems perfectly consistent that methods > > should not be objects, in any case. ¨Âåôèïäó áòåî§ô ªôèéîçóªôèåù§ò> > techniques *things* use to get stuff done. ¨Âèåáò÷èáô ïâêåãô> > know, rather than being objects themselves. > > I can not completely agree with that. One reason why methods should be > objects is because it is great to treat them like this (as the > quasi-method-object called "block" proves) and makes a lot of stuff > easier. Use callbacks for that. They work great. > > Also, you can only bind objects to variables in Ruby, nothing else. So > if I want to use a method in several places that don't know the method > name beforehand, I have to wrap the method in a Proc object. I don't see this as a huge limitation. > > BTW, having functions as objects is not really that unusual, see > Javascript. JavaScript differs from Ruby in at least two ways that bear on this: 1. It uses a different object system abstraction from Ruby's. It is Ruby's model for how objects work that informs my above-stated thoughts on whether it is appropriate for methods to be objects themselves. 2. JavaScript depends on the ECMAScript standard, which is an obscene mess. I don't think it's the world's best example of how other languages should do things (especially class-based OOP languages, given the prototype-based model of JavaScript). JavaScript could have been an awesome language if not for the way the ECMA standards process ruined it. -- Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ] --UlVJffcvxoiEqYs2 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk25opQACgkQ9mn/Pj01uKVBdwCdEuehHmolCQuXKBa7i5hsX7X2 x34AoKqjCYZLOiuXqlnlpKydw9jKUJp/ 9 -----END PGP SIGNATURE----- --UlVJffcvxoiEqYs2--