You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 28, 2017. It is now read-only.
There is currently debate at scala/slip#28 for what the internal representation for a org.json4s.ast.safe.JNumber should be. Currently its a BigDecimal, however there are valid issues with using BigDecimal
On approach from @djspiewak is to use a String, along with a private constructor that checks if the string is a valid number with a cached regex (we need to do this, as safe needs to guarantee that a JNumber is actually a valid number)
Another approach, used by https://github.com/argonaut-io/argonaut, is to have JNumber as a sealed abstract class with different number types as options. I am less open to this as it creates a lot of complexity, prefer the string approach with having a regex to check that its valid
The text was updated successfully, but these errors were encountered:
There is currently debate at scala/slip#28 for what the internal representation for a
org.json4s.ast.safe.JNumber
should be. Currently its aBigDecimal
, however there are valid issues with usingBigDecimal
On approach from @djspiewak is to use a
String
, along with a private constructor that checks if the string is a valid number with a cached regex (we need to do this, assafe
needs to guarantee that aJNumber
is actually a valid number)Another approach, used by https://github.com/argonaut-io/argonaut, is to have
JNumber
as a sealed abstract class with different number types as options. I am less open to this as it creates a lot of complexity, prefer the string approach with having a regex to check that its validThe text was updated successfully, but these errors were encountered: