On 04/12/11 19:09, Robert Klemme wrote:
> On Mon, Apr 11, 2011 at 5:20 AM, Clifford Heath<no / spam.please.net>  wrote:
>> On 04/11/11 10:02, Charles Oliver Nutter wrote:
> monkey patch Hash since you did already so for Fixnum.  On one hand
> you use Ruby's openness to change core classes to achieve what you
> want but on the other you seem to refuse to change another to make
> your change complete.  The only reason for this that I can detect is
> that you were surprised and your expectations were not met.  But now
> since you have learned otherwise what stops you from dealing with the
> situation in the pragmatic way that is so typical for Ruby?

I'm trying to express a logical programming paradigm, for users
of my API - for myself I'm happy to work around whatever I need
to.

>> Another thing that could be done to assist; make sure
>> that a Hash only ever calls eql? on objects in the hash,
>> not on lookup keys.
> But it also would not have any positive impact for all others plus
> that a change always brings a certain amount of risk of introducing
> errors.  Note though, that there might be situations where you want
> the exact opposite:

No. The reason a Hash uses eql? is to know whether it has found the
element which it's looking for *in the Hash*. It should only do that
comparison in one direction.

> You happen to need the way that is not possible right now.

On the contrary, I could live with it being either way.
The different interpreters do it both ways, or not at all.
That is the fact. That you've missed it makes me think you
*still* haven't actually run my code on the three interpreters
I mentioned. if that's true, it just underscores my suspicion
that you're engaging in defensive sophistry rather than rational
argument.

>> People don't do it because it doesn't work, not because
>> it wouldn't be useful.
> How do you know?

Because, as you say they deal with things in "the pragmatic way that
is so typical for Ruby". in other words, they're prepared to hack
around Ruby's hacks. Forgive me for the crime of suggesting that we
should improve things instead.

Clifford Heath.