From: Marcin 'Qrczak' Kowalczyk Date: 2003-10-02T03:16:06+09:00 Subject: Re: Making == symmetric? W li�cie z �ro, 01-10-2003, godz. 19:31, Sean O'Dell pisze: > My own opinion on this is: == is like asking one object if it's equal to > another. I know that particular operator is supposed to provide a > balanced equality test, but I only thought of == that way early in my > programming career; that notion has long since been replaced with the > notion that one side is asking if the other side is equal, and switching > things around will yield different results. Because of this, the way > Ruby handles == always made perfect sense to me. This is like saying "my programming model is unable to describe the reality accurately, so let's change the reality to make it fit the model". For me this is simply a shortcoming in the traditional single-dispatched OO way of thinking, that it can't make the meaning of == depend on the types of both arguments. I don't say that the language should enforce == to be symmetric. I say that the language should allow to define a symmetric == with the desired meaning. So I'm a fan of generic functions. Unfortunately they don't quite fit Ruby (or Ruby doesn't quite fit my programming model) - I don't know if emulating them in Ruby is worth the effort. -- __("< Marcin Kowalczyk \__/ qrczak@knm.org.pl ^^ http://qrnik.knm.org.pl/~qrczak/