G
Gary Wright
Right -- what I mean is, to_s is OK for strings and symbols but not
for integers.
I'm not following you:
irb(main):001:0> 186.to_s
=> "186"
irb(main):002:0>
Gary Wright
Right -- what I mean is, to_s is OK for strings and symbols but not
for integers.
Right -- what I mean is, I am stupidRight -- what I mean is, to_s is OK for strings and symbols but not
for integers.
Yes butI'm not following you:
irb(main):001:0> 186.to_s
=> "186"
irb(main):002:0>
Yes but
2 < 10
while
2.to_s > 10.to_s
Ah, I was missing the context of 'sorted keys'.
It seems to me that the desire to have sorted keys and
to also have keys that are not comparable would be
an indication that something isn't quite right, either
the design is wrong or there are some bugs to be
removed.
Ah, I was missing the context of 'sorted keys'.
It seems to me that the desire to have sorted keys and
to also have keys that are not comparable would be
an indication that something isn't quite right, either
the design is wrong or there are some bugs to be
removed.
It's not that integers aren't comparable; it's that they're an example
of something you wouldn't want to filter through to_s prior to
comparing.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.