unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Herman, Géza" <geza.herman@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: "Géza Herman" <geza.herman@gmail.com>, emacs-devel@gnu.org
Subject: Re: Improving JSON pretty printing, how to represent floats?
Date: Fri, 05 Apr 2024 18:46:17 +0200	[thread overview]
Message-ID: <87ttkf4tq8.fsf@gmail.com> (raw)
In-Reply-To: <865xwv6cx9.fsf@gnu.org>


Eli Zaretskii <eliz@gnu.org> writes:

>> From: Herman, Géza <geza.herman@gmail.com>
>> Cc: Géza Herman <geza.herman@gmail.com>,
>>  emacs-devel@gnu.org
>> Date: Fri, 05 Apr 2024 15:16:44 +0200
>>
>>
>> Eli Zaretskii <eliz@gnu.org> writes:
>>
>> What if I open a .json file because I want to edit it a little 
>> bit
>> (renaming some members, etc.), but then I realize that the 
>> format of
>> the json is bad, so I reformat it.  But I want to maintain the
>> precision, because I intend to use the .json in some other 
>> software
>> which supports arbitrary floating point precision.
>
> Well, you can't.  It makes no sense.  Floats are objects with 
> certain
> semantics, they are not just arbitrary strings.

I wrote "arbirary floating point precision", not arbitrary string. 
There are libraries which work with arbirary precision floating 
point values, and I'm sure that there are JSON files which contain 
such numbers.  If a scientist uses Emacs to format their JSON 
files, they might get surprised that their values in the JSON file 
will be modified during a pretty formatting process. Again, this 
is simply a bad behavior.

Anyways, it don't want to argue about this further.  It's clear as 
day to me that a formatter should not change values in a JSON 
file, you have other opinion.

I thought that it made sense to improve this in Emacs (as it seems 
pretty trivial to do), but then I won't.



  reply	other threads:[~2024-04-05 16:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-05  9:39 Improving JSON pretty printing, how to represent floats? Herman, Géza
2024-04-05 12:35 ` Eli Zaretskii
2024-04-05 12:53   ` Mattias Engdegård
2024-04-05 12:55   ` Herman, Géza
2024-04-05 13:09     ` Eli Zaretskii
2024-04-05 13:16       ` Herman, Géza
2024-04-05 14:01         ` tomas
2024-04-05 15:34         ` Eli Zaretskii
2024-04-05 16:46           ` Herman, Géza [this message]
2024-04-05 13:37 ` Dmitry Gutov
2024-04-05 14:20   ` Herman, Géza
2024-04-05 16:47     ` Dmitry Gutov
2024-04-05 14:18 ` Mattias Engdegård
2024-04-05 14:25   ` Herman, Géza

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ttkf4tq8.fsf@gmail.com \
    --to=geza.herman@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).