Brice Figureau wrote:

> "one" == 1 is valid (and returns false)
> "one" < 1 is not valid (ArgumentError)
> 
> I don't find this really consistent...

Sorting order and equality are two different concepts, and you can easily
define equality without defining order.  For example, the complex numbers
1+2i, 1-2i, 2+1i and 2-1i are clearly not equal, but which one is larger?

Similarly, Ruby decides that it can see that the number 1 and the string
"one" are not equal, but it refuses to put a sorting order between them.
Ruby *could* have defined an arbitrary sorting order, but wisely (imnsho)
didn't.  And in a dynamically typed language like Ruby, it makes perfect
sense to make equality comparisons between disparate types.


        /Thomas Bellman

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to