Conversation
Deserializing also produces floats.
|
I have mixed feelings about this. We have plans to convert many of our timestamp values from floats to rationals, and so we ultimately want these values to be serialized distinctly. This PR would make us temporarily(?) permissive about silently converting everything to floats, which could lead to headache when we split the types apart. On the other hand, it’s a headache now when you try to serialize a rational and it throws up its hands if you aren’t explicit about the conversion—it’d be best if the serializer knew the type it was supposed to emit, based on the message spec, and converted to float when appropriate. |
| (defmethod %serialize ((payload string)) | ||
| payload) | ||
|
|
||
| (defmethod %serialize ((payload rational)) |
There was a problem hiding this comment.
What about specializing on ratio instead of rational?
|
I can see two ways to do this, since messagepack doesn't natively support a rational type:
|
Deserializing also produces floats.
Closes #23.