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
I've not added new types in the past to keep the Hjson grammar small and because it's not easy to decide which types to add without blowing up the spec.
A possible solution to this problem could be Hjson's quoteless strings. The following is already possible with the current implementations:
This allows formats that are not known by JSON/Hjson to be added without breaking current tools. Anything unknown will be treated as a string.
By using Domain Specific Formats, that can be selectively enabled by the application, we can allow new formats to be added where they are needed. For example
math enables NaN, Infinity and -Infinity (should also support -0)
date enables ISO_8601 dates
hex enables hex numbers
math and date can output the same format when stringified. hex would revert to decimal (unless the desired format were to be stored with the type).
Other formats can be implemented in the application as required.
The text was updated successfully, but these errors were encountered:
Support for additional types and/or formats has been requested several times (hn/reddit/issues):
I've not added new types in the past to keep the Hjson grammar small and because it's not easy to decide which types to add without blowing up the spec.
A possible solution to this problem could be Hjson's quoteless strings. The following is already possible with the current implementations:
This allows formats that are not known by JSON/Hjson to be added without breaking current tools. Anything unknown will be treated as a string.
By using Domain Specific Formats, that can be selectively enabled by the application, we can allow new formats to be added where they are needed. For example
math
enables NaN, Infinity and -Infinity (should also support -0)date
enables ISO_8601 dateshex
enables hex numbersmath
anddate
can output the same format when stringified.hex
would revert to decimal (unless the desired format were to be stored with the type).Other formats can be implemented in the application as required.
The text was updated successfully, but these errors were encountered: