
9 Jul
2011
9 Jul
'11
11:22 p.m.
I don't see why we need to specify that the format is hexadecimal. I would expect that the spirit grammar associated to the coerce library will take care of all the formats without any specific additional tag.
Doing implicit conversion from 0x17 to 'int' without explicit guidance from the user (i.e. by telling to convert from hex) is not a good idea, IMHO. I'd suggest to make the conversion explicit as much as possible, which usually amounts to the least surprised user.
Moreover, a user may want to convert a string like "054F3AB9C4E1" to an integer without having to prefix it with "0x" (think of a MAC address). In this case they need a way of specifying that it's a hex number. Regards, Nate.