From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Herman=2C_G=C3=A9za?= Newsgroups: gmane.emacs.devel Subject: Re: Improving JSON pretty printing, how to represent floats? Date: Fri, 05 Apr 2024 18:46:17 +0200 Message-ID: <87ttkf4tq8.fsf@gmail.com> References: <87msq8w2zm.fsf@gmail.com> <86bk6o56np.fsf@gnu.org> <87bk6o55ci.fsf@gmail.com> <867chc5526.fsf@gnu.org> <877chc5417.fsf@gmail.com> <865xwv6cx9.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35519"; mail-complaints-to="usenet@ciao.gmane.io" Cc: =?utf-8?Q?G=C3=A9za?= Herman , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Apr 05 19:15:40 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rsnAC-000942-MB for ged-emacs-devel@m.gmane-mx.org; Fri, 05 Apr 2024 19:15:40 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rsn9M-0000MW-94; Fri, 05 Apr 2024 13:14:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rsn9K-0000M9-Ti for emacs-devel@gnu.org; Fri, 05 Apr 2024 13:14:46 -0400 Original-Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rsn9I-0001kT-3R; Fri, 05 Apr 2024 13:14:46 -0400 Original-Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-a46a7208eedso345472966b.0; Fri, 05 Apr 2024 10:14:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712337282; x=1712942082; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:in-reply-to:date :subject:cc:to:from:references:from:to:cc:subject:date:message-id :reply-to; bh=FuQG5PPZ4HatbMeAwIb/JwtQ8HqJ8cm9D5fLHBGxdpg=; b=JYoNkdQqG9iP7XDmsB7faA+D/ShkPy4SEMgsKhNgbLhViulohOtFAkhtSVH7crGdSM iFXq3xEf600Do1gFROj0+qKRe1BwHnBJXyaQm2Z/wapDXguk8GelHzvtlAdYNn255k9o Ow6X/GBB2vCbXcKXM/aib+eLcSOIZPWloO2a7l5dXGIbptfm7Wd2rRj4uAmvx0RQdZu8 K2eSUk8r/+KRGztJoRnTnlurl3YORCxbu+YteXpifZh3V9DxHb+xkeRy/fPPYv0mrVDO Wgv3mbIM13Z8pYfbRawgtlM9h2z2S+hkNHR0JnPzDTCvbVegdje70Ehg3Xae8DoB434e X3vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712337282; x=1712942082; h=content-transfer-encoding:mime-version:message-id:in-reply-to:date :subject:cc:to:from:references:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=FuQG5PPZ4HatbMeAwIb/JwtQ8HqJ8cm9D5fLHBGxdpg=; b=wJAJwrXEM9M3OGmXTB7F7vvlIO6+tyhyVVUcPXPGR0z4xCn17/ZCXjYkj/1qme5j94 zbYqwo9vRtMjLtvNrkmD736U8xtYgXlWKLCJJgJ0sPvWzy9K/21g+4hvNL2WVR9r3R7N oUxRH3hBYB96P4C8BmLAdcHydxhUATnVHMc027/Dp6ItgKZRssshLqPiTvRaVlBMiQ6B q4YFrrFc3S89SWjCPwkBR1fq5FAqeXrpuMHqCXA48qQW5HsGZ7jf2csRzzMl+/utcqti IKJmKJxzcz0GpqdmaYsYrUd0OWFr/4HSOybMGXgSEm6CEDR1K7Wi7dBJ5JZNgNF4kdYc NxUA== X-Forwarded-Encrypted: i=1; AJvYcCXVLMPiDSbHAeGwE4bTUA74aTieQinqlcrzSwYL2lVZ3EBnLJNZJk68YwlJmQy7/wg65IrhjkeEE+gj4aMdEarlsGFW X-Gm-Message-State: AOJu0Yy1d1UoqyUjVCJxI7cIlMfCbjeSqadbKqPR3PT/d4ehgsHFezbH SV6/tUoGGdoQEkmKCNkcOyOSbj5lZOsytUPDNhIQyaoPJYILxPddCWyOd931 X-Google-Smtp-Source: AGHT+IHHcsiGwpvC6PXHnL/jECaDba3Y5OXJmvVlMxoHc1aWs/Cx3lLSPrXHnB+MI/miS4Izb7TRjw== X-Received: by 2002:a17:906:39b:b0:a51:982f:d787 with SMTP id b27-20020a170906039b00b00a51982fd787mr1499710eja.20.1712337281440; Fri, 05 Apr 2024 10:14:41 -0700 (PDT) Original-Received: from localhost (62-77-231-86.static.invitel.hu. [62.77.231.86]) by smtp.gmail.com with ESMTPSA id a5-20020a17090640c500b00a4df01f4232sm1038211ejk.189.2024.04.05.10.14.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 10:14:40 -0700 (PDT) In-reply-to: <865xwv6cx9.fsf@gnu.org> Received-SPF: pass client-ip=2a00:1450:4864:20::62c; envelope-from=geza.herman@gmail.com; helo=mail-ej1-x62c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:317558 Archived-At: Eli Zaretskii writes: >> From: Herman, G=C3=A9za >> Cc: G=C3=A9za Herman , >> emacs-devel@gnu.org >> Date: Fri, 05 Apr 2024 15:16:44 +0200 >> >> >> Eli Zaretskii writes: >> >> What if I open a .json file because I want to edit it a little=20 >> bit >> (renaming some members, etc.), but then I realize that the=20 >> 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=20 >> software >> which supports arbitrary floating point precision. > > Well, you can't. It makes no sense. Floats are objects with=20 > certain > semantics, they are not just arbitrary strings. I wrote "arbirary floating point precision", not arbitrary string.=20 There are libraries which work with arbirary precision floating=20 point values, and I'm sure that there are JSON files which contain=20 such numbers. If a scientist uses Emacs to format their JSON=20 files, they might get surprised that their values in the JSON file=20 will be modified during a pretty formatting process. Again, this=20 is simply a bad behavior. Anyways, it don't want to argue about this further. It's clear as=20 day to me that a formatter should not change values in a JSON=20 file, you have other opinion. I thought that it made sense to improve this in Emacs (as it seems=20 pretty trivial to do), but then I won't.