From: bbense+comp.lang.ruby.Sep.26.02@... Date: 2002-09-27T05:16:38+09:00 Subject: Re: adding overload to ruby -----BEGIN PGP SIGNED MESSAGE----- In article <1033038093.4274.0@iapetus.uk.clara.net>, Justin Johnson wrote: > >This means that the dispatcher must find the _closest_ match rather than >just using '==='. > >Doing multi dispatch does seem possible, but Matz seems to think it would be >troublesome. IIRC, other people have shown concerns too. > >How would having this feature detriment the language? > - - It violates the spirit of Ruby. IMHO, anything that does raise ArgumentError unless ( foo.type? == String ) does this as well. It short circuits much of the power of the language to allow people to use ideas they are comfortable with. It destroys much of the flexibilty of the language. If you really think you need those chains then you should be using another language. - - As I stated in a previous post this method overloading is nothing but strict type checking in disguise. IHMO, one of the whole points of ruby is to get beyond the limitations of type checking and start to think in different and more powerful ways. You lose much of the inherent power of objects when you tie them down with type checking. - - Some thing that I would like to see more support for is the idea of Interfaces from Objective C. This is a kind of contract of methods that you support. Modules and the kind_of? method sort of support this, but not in a very straightforward way. Also, I think much of the demand for various kinds of "typed" Ruby could really be satisfied by rethinking the structure of error objects. - - Booker C. bense -----BEGIN PGP SIGNATURE----- Version: 2.6.2 iQCVAwUBPZNmb2TWTAjn5N/lAQHDBwQAo14dbr3U+0omtX+m/c63zTfd/X6L5wl3 Uf1B2aZpOSz8R93BNssBCcUE2PN/OJcIR9CqI3/cND1cwkNzCgUvVUwMIki+Rt3i PDlxib6SpblZJNLTP/n43BkSrC175wdQLWwBKGNnq+51dxmZlX4O6ZiFFjxLYP7B KFlWMKoAbyo= =KDf3 -----END PGP SIGNATURE-----