On Wed, 2008-11-19 at 16:40 +0100, Thomas Bellman wrote: > 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?
My Math lesson are really old nowadays, but I vaguely remember there is no total ordering in C. > 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. Yes, you are completely right, that makes perfect sense. I guess I'm using too many different languages (strongly typed or not) in the same day to be able to remember how all are working :-( Thanks for the explanation, -- Brice Figureau <[EMAIL PROTECTED]> --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
