From: Phlip Date: 2009-02-14T04:43:33+09:00 Subject: Re: If you are unhappy with the direction of Ruby 1.8.7+, respond William James wrote: > Normal hash-tables are ordered nowhere, no-how, and no-way. > A 9-year-old boy wanted to keep track of the color of his > toys. He wrote "car: red" on a piece of paper which he then > put in a bag. Then he did the same with "airplane: silver" > and "ball: blue". Days later, he decided to review the data. > He reached into the bag and pulled out a slip. It didn't > say "car"! It was the slip with the color of the ball! > The slips were coming out in the wrong order! There's a big difference between abstract computer science theory and pragmatic technology. Ruby uses option-hashes as an emergent "named parameters" system. We have hundreds of DSLs written with them. After these DSLs can see the order that the user-programmer wrote the parameters, they are free to use this order to grow more powerful. Just because one (technological) implementation of hash tables throws information away, that does not mean it was _required_ to throw that info away. How about we give you your own special version, HashWithIndifferentOrder, that guarantees it randomizes key order? And along the way, we can give you := for assignment, and = to test equality, because - you know - the = operator has always meant equality, not assignment. -- Phlip