emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Improving JSON pretty printing, how to represent floats?


From: Herman , Géza
Subject: Re: Improving JSON pretty printing, how to represent floats?
Date: Fri, 05 Apr 2024 16:20:22 +0200


Dmitry Gutov <dmitry@gutov.dev> writes:

On 05/04/2024 12:39, Herman, Géza wrote:
What would be the best representation for numbers in this case? I'm thinking about using symbols, but I'm not sure this is the best approach.  The parser/encoder would have a new keyword parameter, like ":numbers-as-symbols t".  If this is specified, then numbers wouldn't be parsed, but kept as symbols.  What do you think, is this a good approach?

Why not just use strings? Bignum implementations in various libs (other languages) often use strings in constructors.

Because then the original type is lost: Later it's not possible to tell whether a value was a number or a string originally.


Interning numbers in obarray doesn't seems like too great an idea.

That's correct, my idea is to use uninterned symbols (make-symbol).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]