From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: Improving JSON pretty printing, how to represent floats? Date: Fri, 5 Apr 2024 16:37:04 +0300 Message-ID: <4acdf9ac-7147-43c5-b4cc-12f0e3960f81@gutov.dev> References: <87msq8w2zm.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25517"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird To: =?UTF-8?Q?Herman=2C_G=C3=A9za?= , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Apr 05 15:37:35 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 1rsjl8-0006Lx-15 for ged-emacs-devel@m.gmane-mx.org; Fri, 05 Apr 2024 15:37:35 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rsjko-0005QT-7O; Fri, 05 Apr 2024 09:37:14 -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 1rsjkl-0005QD-3v for emacs-devel@gnu.org; Fri, 05 Apr 2024 09:37:11 -0400 Original-Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rsjkj-000472-7i for emacs-devel@gnu.org; Fri, 05 Apr 2024 09:37:10 -0400 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id EF8275C0087; Fri, 5 Apr 2024 09:37:07 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Fri, 05 Apr 2024 09:37:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1712324227; x=1712410627; bh=pYu+ZWFaUspzuoD5l5Zpmo6xqHQ2Fs8DpnhO/QTVlM0=; b= X8ACBDyI4hEnM/WBTztFv6cviMnGEhqLSi7LIc1X+0GgFTj59m8RC21DuoTqmdZe FzkS4HclLTLgABL7YiUtsx2b/c+1FNbmnRC90x2b/dHvuDj0X2mQ6TlQAzv6Dl65 JafwKO+lDNGiFEqodhgZm/CNberrlr98MhRvE6YInwqh3mhAdFpJq/dZePR/0It+ 12OX3keug2QR6vmWqfnmTgoo24PRYDGbL1xKWz9+EiogeTE+FFZbp0FJXuof8Vbg La+0YneX1q+LquZApgrr5w7v7iK4aTvwroqW+WQ2mkHA4erdkIty5jOxj3z6vOK7 1nbsU6G2j3DwHI2zm/u8Lw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1712324227; x= 1712410627; bh=pYu+ZWFaUspzuoD5l5Zpmo6xqHQ2Fs8DpnhO/QTVlM0=; b=Y bG/C5VM3YiG7MjmZ7pHYC2HRPuejXGmd6I/lg7EOH7zMuWnB0tlbLaFnx2KOxPvM LhZpNxr6s6aTQ4QuvmBTuS/KNk560p7VHCjqTXAjYWvxeknc3jPTPTsahSKPRc3g 9PpXnp+mhDypuTbSf/zpKZ1y/v6BB6Jr44G3X8W7wl6R+qEAPYuqmUgl3BuQC5zb keTgaMTaC/xogzcH5UIlFNd++M7xwaggPCScXl9uXV3Td+IKWf9iqNWcTwNG0+gl OjYg/PzX9tcBcykq2+mbiNb6aSmRN8G7aZKo33Np3TkNzmO/5gDU1eScYY09PXvW vchPMM6RBS5BlxRBMSbIQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudegtddgieekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtke ertddtvdejnecuhfhrohhmpeffmhhithhrhicuifhuthhovhcuoegumhhithhrhiesghhu thhovhdruggvvheqnecuggftrfgrthhtvghrnhepgeeugeetffduvdejvedvleeliedtfe dtudfhfeefffejudekveejvdeffffgveegnecuvehluhhsthgvrhfuihiivgeptdenucfr rghrrghmpehmrghilhhfrhhomhepughmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 5 Apr 2024 09:37:06 -0400 (EDT) Content-Language: en-US In-Reply-To: <87msq8w2zm.fsf@gmail.com> Received-SPF: pass client-ip=66.111.4.25; envelope-from=dmitry@gutov.dev; helo=out1-smtp.messagingengine.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_SBL_A=0.1 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:317547 Archived-At: 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. Interning numbers in obarray doesn't seems like too great an idea.