[#6363] Re: rescue clause affecting IO loop behavior — ts <decoux@...>

>>>>> "D" == David Alan Black <dblack@candle.superlink.net> writes:

17 messages 2000/11/14
[#6367] Re: rescue clause affecting IO loop behavior — David Alan Black <dblack@...> 2000/11/14

Hello again --

[#6582] best way to interleaf arrays? — David Alan Black <dblack@...>

Hello --

15 messages 2000/11/26

[#6646] RE: Array Intersect (&) question — Aleksi Niemel<aleksi.niemela@...>

Ross asked something about widely known and largely ignored language (on

23 messages 2000/11/29
[#6652] RE: Array Intersect (&) question — rpmohn@... (Ross Mohn) 2000/11/29

aleksi.niemela@cinnober.com (Aleksi Niemel) wrote in

[#6723] Re: Array Intersect (&) question — Mathieu Bouchard <matju@...> 2000/12/01

> >Use a hash. Here's code to do both and more. It assumes that

[#6656] printing/accessing arrays and hashes — raja@... (Raja S.)

I'm coming to Ruby with a Python & Common Lisp background.

24 messages 2000/11/30

[ruby-talk:6645] Re: Hash with a key of nil ?

From: rpmohn@... (Ross Mohn)
Date: 2000-11-29 18:40:02 UTC
List: ruby-talk #6645
Dave@thomases.com (Dave Thomas) wrote in
<m266l6ofsd.fsf@zip.local.thomases.com>: 

>rpmohn@panix.com (Ross Mohn) writes:
>> 
>> 1) Should nil be allowed as a Hash key? This does not make sense to
>> me. 2) Maybe there should be a method defined for nil.<=> ? I think if
>> it always returned -1 it would be appropriate.
>
>Perhaps the alternative questions might be: should you always be able
>to sort a hash based on it's keys? I suspect the answer is "no".  For
>example:
>
>    h = { STDIN => 1, STDOUT => 2 }
>
>    STDIN <=> STDOUT
>    NameError: undefined method `<=>' for #<IO:0x401900a4>
>
>
>Hash keys need only provide #hash and #eql?. There's no requirement for 
><=>, so in general you can't rely on being able to sort a hash.

I guess so, but I don't know if I'm convinced yet. Maybe it's just that I'm 
not used to such a flexible language?

Thanks for re-stating the question more correctly -RPM
-- 
Ross Mohn
rpmohn@panix.com

In This Thread