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 16:20:22 +0200 Message-ID: <8734rz6g8v.fsf@gmail.com> References: <87msq8w2zm.fsf@gmail.com> <4acdf9ac-7147-43c5-b4cc-12f0e3960f81@gutov.dev> 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="14769"; mail-complaints-to="usenet@ciao.gmane.io" Cc: =?utf-8?Q?Herman=2C_G=C3=A9za?= , emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Apr 05 16:24:21 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 1rskUN-0003YZ-88 for ged-emacs-devel@m.gmane-mx.org; Fri, 05 Apr 2024 16:24:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rskTX-0003ym-5W; Fri, 05 Apr 2024 10:23:27 -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 1rskTT-0003yO-4z for emacs-devel@gnu.org; Fri, 05 Apr 2024 10:23:23 -0400 Original-Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rskTR-000692-77 for emacs-devel@gnu.org; Fri, 05 Apr 2024 10:23:22 -0400 Original-Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-a51ad517450so44273166b.2 for ; Fri, 05 Apr 2024 07:23:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712326999; x=1712931799; 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=Hy1obghzhTKhQjQhbExSdgpPlgaL6jpLz3lq+m4rNQA=; b=YhSxecKa0FD9st7G+uo6blm3oWRhPZ1sm5EnFsGN3vofVM+MPYN55sPoQC8DabQa8d BoBKEc73RspPZtm2xolnRb4FoxGNwpUxGM+1hjKWXexKk1onlclM2eLP8d8Q1/LoRPnq F65DqxxQsgnU2Mbbl32cWFxDAXVJpMMAfe9n49wExF9xh7Tmfz4U7HgMRos9cgmIJgVL IBDPUh/HGAuPATZp8AJvkeVwWVpQJpvYpwThK2MWgLSsgRSEaVTZl4sTOZE20IIipkIa 8IvizHgkw4bGLEpBC+qknG8n6fDQtNdQ+IFcrVlmgRh7qFK4eqo8RJH7iMrPcietnfA7 uGgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712326999; x=1712931799; 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=Hy1obghzhTKhQjQhbExSdgpPlgaL6jpLz3lq+m4rNQA=; b=pPol6ZbLn1eecwPP9cueFBYZHADEC7a//QqFpr0GOyCsgt+qHuIT/TFWm2T1a226rY /S/oeW0qnF09g/MbIMNDI9V2q9v1e+rbd+agY6MpiNgXjESCDDTF08OyAMBpknXm09XA NYaRUqaUiUzfAbpPzLNrcENBpfnsgJiHvhi2+f3M9M2z0G9XkACyIWTQnv3mXH75VeyK Z4cJELX4VIZwLEnFZttCzHgOVJFfMK7eSx/yms8mHiWBy5eT4GQHyRWDxm2y9ImJCWu/ o/N6upsa1AOAa/06O5+up4nP6c2oDRg5godSVTYANMllGajmxchQolR/NWT2TeDCtaHQ qnKg== X-Forwarded-Encrypted: i=1; AJvYcCVMiTw6i3w64ja5dM409+Nf/8yNlsfOVO/nugrG9fTLtwAxBNXyYMy952abJ8govXqckWguCLqBDeiFAAiq75QXQYcZ X-Gm-Message-State: AOJu0YwQcFOxLFiFkh4sIiX9MVkBBcIMFN0416/bvHl3fUgWbwkwZINt x7w8sr3mGhVbv6HwOTAa/WiD3Nw1wE83p+37dqwLU4V0kRjzsYaD5rzg+cIg X-Google-Smtp-Source: AGHT+IGZr2bzUo0mGzaPcjqwPQzd/J0lZFRMTUQCGVOL5+evGg8J8cQhddfGfYWSvUT2BaHuVrst+Q== X-Received: by 2002:ac2:538e:0:b0:516:bfd4:351b with SMTP id g14-20020ac2538e000000b00516bfd4351bmr1013778lfh.65.1712326978410; Fri, 05 Apr 2024 07:22:58 -0700 (PDT) Original-Received: from localhost (62-77-231-86.static.invitel.hu. [62.77.231.86]) by smtp.gmail.com with ESMTPSA id jx5-20020a170906ca4500b00a4e35cc42c7sm894211ejb.170.2024.04.05.07.22.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 07:22:57 -0700 (PDT) In-reply-to: <4acdf9ac-7147-43c5-b4cc-12f0e3960f81@gutov.dev> Received-SPF: pass client-ip=2a00:1450:4864:20::62f; envelope-from=geza.herman@gmail.com; helo=mail-ej1-x62f.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:317550 Archived-At: Dmitry Gutov writes: > On 05/04/2024 12:39, Herman, G=C3=A9za wrote: >> What would be the best representation for numbers in this case?=20 >> I'm thinking about using symbols, but I'm not sure this is the >> best approach.=C2=A0 The parser/encoder would have a new keyword=20 >> parameter, like ":numbers-as-symbols t".=C2=A0 If this is specified,=20 >> then >> numbers wouldn't be parsed, but kept as symbols.=C2=A0 What do you=20 >> think, is this a good approach? > > Why not just use strings? Bignum implementations in various libs=20 > (other languages) often use strings in constructors. Because then the original type is lost: Later it's not possible to=20 tell whether a value was a number or a string originally. > > Interning numbers in obarray doesn't seems like too great an=20 > idea. That's correct, my idea is to use uninterned symbols=20 (make-symbol).