From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id EOmMBvNnRmM5OgAAbAwnHQ (envelope-from ) for ; Wed, 12 Oct 2022 09:08:35 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 2HmnBvNnRmMUGwAA9RJhRA (envelope-from ) for ; Wed, 12 Oct 2022 09:08:35 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id EB14A3F8DD for ; Wed, 12 Oct 2022 09:08:34 +0200 (CEST) Received: from localhost ([::1]:47012 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oiVqz-0000mE-KY for larch@yhetil.org; Wed, 12 Oct 2022 03:08:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37496) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oiVqU-0000ki-E7 for guix-patches@gnu.org; Wed, 12 Oct 2022 03:08:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:56406) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oiVqU-0008DQ-61 for guix-patches@gnu.org; Wed, 12 Oct 2022 03:08:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oiVqT-00060V-Vn for guix-patches@gnu.org; Wed, 12 Oct 2022 03:08:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57963] Almost plain SXML serializer Resent-From: Andrew Tropin Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 12 Oct 2022 07:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57963 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Liliana Marie Prikler , Taiju HIGASHI Cc: ludo@gnu.org, 57963@debbugs.gnu.org Received: via spool by 57963-submit@debbugs.gnu.org id=B57963.166555847523078 (code B ref 57963); Wed, 12 Oct 2022 07:08:01 +0000 Received: (at 57963) by debbugs.gnu.org; 12 Oct 2022 07:07:55 +0000 Received: from localhost ([127.0.0.1]:55484 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oiVqN-000609-46 for submit@debbugs.gnu.org; Wed, 12 Oct 2022 03:07:55 -0400 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:59823) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oiVqK-0005zv-Go for 57963@debbugs.gnu.org; Wed, 12 Oct 2022 03:07:54 -0400 Received: (Authenticated sender: andrew@trop.in) by mail.gandi.net (Postfix) with ESMTPSA id 5723B20002; Wed, 12 Oct 2022 07:07:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop.in; s=gm1; t=1665558466; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=/PzoIGULmpAnquqMIavwc1diosV4ohbDDdhfCGK0fEo=; b=nZmFCoPkPqZ1V1+4xpYop9LZ0RKOQNcSsyJ1YzeC5BGa6EN1XnIXsbTTTN4GMRmPLv0mvZ wHVRlru59UNidONvRTBhHprKUbq7DORljT5f5epPAnTYR/oAHIVCjepM51e+z9I3aDw7Zf IdibFo7fckYC7pA3iSsOnqoJEefN4x37QjTLXSKD3wWVIhRzIkQQW7FCgrNE1h3xBFi7ym 29umL3tmCFNlgk5coAL0h/vcK33WScmWKhrEIZLgUrI2Xxd5yMbmqvCDVD0wEgZa+HSZi6 EUtmau8XoNhSK82IhiOK6wg9AMgXqmKS9AbYm4PZuM+GmJf45SRNE+MUzw7D6g== From: Andrew Tropin In-Reply-To: <7a7ba84518d2f6afa387e1e2649bc249acd74750.camel@gmail.com> References: <20221002131535.9972-1-higashi@taiju.info> <20221002131535.9972-2-higashi@taiju.info> <87zge4chb5.fsf@trop.in> <87edvfkob8.fsf@taiju.info> <7a7ba84518d2f6afa387e1e2649bc249acd74750.camel@gmail.com> Date: Wed, 12 Oct 2022 11:07:33 +0400 Message-ID: <87pmexmsei.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1665558515; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=/PzoIGULmpAnquqMIavwc1diosV4ohbDDdhfCGK0fEo=; b=iMhcSh1bvqWU0C+MYL/HWM0RePTbd3eS5C12N7p8HD7F2c3rPcSo1/gaKuNGSvM0kretrg 3jEZiDwzuwALjmxxM2xuld6NBttiahjUtRnRsXx9EcAQGa5Hyje5zhr2J1L7B+DETl11lT eHKj+2R9XxVBQdOIXHrG9W0jnb5GgRSw7Rro4HecFnnpmWyaZkw417SBK49cmy9ftw1s4I b/JkYlX+iOeuzbPfmwk2Ynb2tZJj65xWfO9ellNZnQjDrzFqQLmn+UfHVoCpnl2SP/n2kU RUxHxd0rk7e2Yp+Xihx3Liyf2W2BcpG0eTWcyDE+fcto5062/9ikSEUktkob0Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1665558515; a=rsa-sha256; cv=none; b=kgaZS5fANrcYXUGffCrJDfkU769hLzKgEPoR9+/U0G+AfQ7Q8xCqJs5lNEIDDysGTjfRJj DwemUmim1Rk3ojbXQucOJeQm1f8vsaIOHR61dIqGNSp3DIXzOVYOvACPmT73LldPz2M79O or5BbVlq3273CAyB3d2ots91z4VL0Mk11ZhdW8eROsJW1uvmP5IzE6x2fIcxB/4DGNtnpA U8XJah7U6OP4HSdZp4StUpCtFBtuVm7GsYzFpv/pjiccdEYx81xuxoje3j3cPVKk3p+SIh SbXx3du3E6rNpg73bT42xmWac05QIVhe9dVBEHgKkcpQ4bWhccLM/+Ku8cCCIg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=trop.in header.s=gm1 header.b=nZmFCoPk; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 0.60 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=trop.in header.s=gm1 header.b=nZmFCoPk; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: EB14A3F8DD X-Spam-Score: 0.60 X-Migadu-Scanner: scn0.migadu.com X-TUID: ipQobUjiVK6b --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On 2022-10-11 06:21, Liliana Marie Prikler wrote: > Am Dienstag, dem 11.10.2022 um 12:54 +0900 schrieb Taiju HIGASHI: >> We can specify invalid value such as (list "foo" '(foo bar) 123). > It will be sanitized before that. > >> > Also, making multi-type fields is debatable, but isn't great IMO. >>=20 >> I see. If we had to choose one or the other, I would prefer the >> string-type field. > Prefer sexp-type. > Current (v5) extra-config has a list type. This list can contain strings and nested lists, string elements are for raw XML, and list elements are for SXML. This is done I guess to support following use case: =2D-8<---------------cut here---------------start------------->8--- (list "Already existing XML copied from existing .xml file, which we don't want to rewrite to SXML." '((tag (@ (attr1 "value1") (attr2 "value2")) (nested "Part of the configuration defined with SXML") (empty))) "Maybe some other part of raw XML") =2D-8<---------------cut here---------------end--------------->8--- This way we can combine SXML with already existing raw XML. Am I right? >> > If serialization would support G-exps, we could write >> >=20 >> > (list #~"RAW_XML_HERE") >> >=20 >> > or even something like this: >> >=20 >> > (list #~(READ-THE-WHOLE-FILE #$(local-file "our-old.xml"))) >>=20 >> Does it mean that the specification does not allow it now? Or does it >> mean that it is not possible with my implementation? > I think your serialize would have to unpack the G-Expressions. You can > test that with some example configs of your own. > >> >=20 > Cheers =2D-=20 Best regards, Andrew Tropin --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmNGZ7UACgkQIgjSCVjB 3rACTxAAgofw7IrJ8T85rEom7ncoIF3E20jNhvDa34qXS2oxAzrqgCJpNNHDQZfM t2V7RI+oqeliC0doWQTmz+gSlpbL4ilX8cFTr12fROE6wS5Mn9KQH2jeRtkGK8eC lBj22I7wnnQHYP+5nJWvF0maPZdPU914kXcxBmFN1wJuf5k5uL3uwJf8hgAxLDG/ mkmBgQ/PLLLxgKmDcx/YVb9roPQHG9Tz6W7rbVsoWZy+1bCLYkZApUIXDALGb82w 0YQ3gkTia1E6cNEtEkrOaFGLO1UQPZyEj6S7DvRqkoSH90J/ShaI5gTUYGLdCMC2 +EFwVH9YGW4Sb9DF5V2oVuJyT5nc+NMtjG+InBcKBgRoTLwFHejjLoROBFfqj2bx QmB3lDzXmWmt9QSonfMEBK8VUi89wsDrFkIxafATm7x42Ck7GodyrP8jW1wRx2+M m6m0isQ3ykIojEr9bkWGSJw+eFqEh3qPjohwcgRSxphd0w0Z+597oy2CfciXxJzo C0LY4lnFyfirasQ5fMG78FKunHQwjE++EW6BTmaRPzAjB7sE6CTbFcMPp4mx1iyU HMQxAQWl9IkyrSOuYu8ZT2+jhPAkh0Dn4DzgmEjBj1MxU3E9HMorwDm+YBP79Qsk S9Q1iHk5AmXr4ULXF0KkZUDGdh5bpFawWdwSAEScMmpWg53TE5E= =uiRO -----END PGP SIGNATURE----- --=-=-=--