From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id yDswF8EJR2PMfgAAbAwnHQ (envelope-from ) for ; Wed, 12 Oct 2022 20:38:57 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id r8gkF8EJR2OkDAEA9RJhRA (envelope-from ) for ; Wed, 12 Oct 2022 20:38:57 +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 890273AFC7 for ; Wed, 12 Oct 2022 20:38:56 +0200 (CEST) Received: from localhost ([::1]:43020 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oigd5-0002ca-MA for larch@yhetil.org; Wed, 12 Oct 2022 14:38:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39144) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oigOg-0005Gw-9u for guix-patches@gnu.org; Wed, 12 Oct 2022 14:24:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:59343) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oigOf-0002CE-Vi for guix-patches@gnu.org; Wed, 12 Oct 2022 14:24:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oigOf-0007UU-Hw for guix-patches@gnu.org; Wed, 12 Oct 2022 14:24:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57963] Almost plain SXML serializer Resent-From: Liliana Marie Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 12 Oct 2022 18:24: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: Andrew Tropin , Taiju HIGASHI Cc: ludo@gnu.org, 57963@debbugs.gnu.org Received: via spool by 57963-submit@debbugs.gnu.org id=B57963.166559899928737 (code B ref 57963); Wed, 12 Oct 2022 18:24:01 +0000 Received: (at 57963) by debbugs.gnu.org; 12 Oct 2022 18:23:19 +0000 Received: from localhost ([127.0.0.1]:58421 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oigNy-0007TQ-Mt for submit@debbugs.gnu.org; Wed, 12 Oct 2022 14:23:19 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:41588) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oigNw-0007TA-Tx for 57963@debbugs.gnu.org; Wed, 12 Oct 2022 14:23:17 -0400 Received: by mail-ed1-f67.google.com with SMTP id z97so25599665ede.8 for <57963@debbugs.gnu.org>; Wed, 12 Oct 2022 11:23:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=uu9JyCd3lYWT9h6h8iJAWurn0JFYQCFGhLZvWAFToRY=; b=lPftW3L34qjoF7jmZPUAvooHnhIppFZoNmGlhnik7dMOUwm/ZjCSlRa9TcQ2+5P36I wa9+iqmhW76sO+ZsaaprDR3010FJwcqolIieQ1Ap95LoHJ73vvt5lH7x5to2zXo8Ab4F LjFtm7zR4w1o29oEL0Nn6RMeR7ZNwLHi3FCg+XxbHDo6kSRM985ThTUE5IjfMqO+70+Z TfZtqRbyGvKTbWIKoX0QGSvzekWek3d7x1pbsQ/rvwIPn7fcTsDCS04VAVkHzkQfEuAN U5U8WXi9VDntCBLknQS7FPSemLgw5a/iQfFXkONJhMasAWqDZwHjUQC0Z1pTtJ4N1DUu rjYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=uu9JyCd3lYWT9h6h8iJAWurn0JFYQCFGhLZvWAFToRY=; b=HK8UsFsi0GR5N2ZdZwF8bg5lFgcX3OPu5ilpJ0vXf/Aa4ALiSsqstUH60nvbjsFCT5 mS0+RejWlpKo4Jbo/wNKVj1ZZeaXNZEebRGlWLJd0//a7pF8RWBmCn891eheLSvtvex9 HW7Yh23jVU6aVH5v/hJazW6GI9ULKF8ayeQM+1ysRokRVm23n9KU8yDj7yO3bYVjxTkS MxixN2IHSGPDxhvaARPkoF1sA1GSICw2LevLbKTppbxHxnziEtHD6y+6LDiZsA56geiy gh8P6kPChlMzFV1nYBNMznjpl7Xoil+Hs56u8RGpW7LzUQ7weRy54b/6TylSrgAkscaR dFFA== X-Gm-Message-State: ACrzQf1g9HmYE5QavPjDKB46GKPtYl9ace8bQOotXefU/H88SMQTIjeb 3gCXstb7Rojb12GkKGYtlnM= X-Google-Smtp-Source: AMsMyM41NUqmFV0HVbkjHfgzmXobc3aNp7LFQ1C2YVuwc392gk4+x5vtyqOYfJGK46FqdPwbzkDTJQ== X-Received: by 2002:aa7:c04f:0:b0:457:1b08:d056 with SMTP id k15-20020aa7c04f000000b004571b08d056mr29484829edo.146.1665598989813; Wed, 12 Oct 2022 11:23:09 -0700 (PDT) Received: from lumine.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id z14-20020a170906074e00b007828150a2f1sm1681523ejb.36.2022.10.12.11.23.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Oct 2022 11:23:09 -0700 (PDT) Message-ID: <4e239948c075c47041a4ac1087b25de65a9172b3.camel@gmail.com> From: Liliana Marie Prikler Date: Wed, 12 Oct 2022 20:23:08 +0200 In-Reply-To: <874jw9mbxc.fsf@trop.in> 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> <87pmexmsei.fsf@trop.in> <87a661i7zm.fsf@taiju.info> <874jw9mbxc.fsf@trop.in> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.0 MIME-Version: 1.0 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=1665599936; 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: content-transfer-encoding:content-transfer-encoding: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=uu9JyCd3lYWT9h6h8iJAWurn0JFYQCFGhLZvWAFToRY=; b=WqKyzrLBUiX0kxbuWqVh7Lv1OgkPVoG0PDKrXLgzsmpDwLbPnbUkR0AQegV+kpAdRzrYhZ hodubtQ6+4L19uhft7H1QKhgILROR/MQIBDJm6ke0hvjh1s39BmcvtwSLN0LiMarwD1RmB AI4KtFGTOxGZ82Ps2pkkfFpiuoJMDE9CNPgByTUI6KkSLj5CjQy71eTr8ZJoZFWyhQ39ma VbOQiYuBaULPkASkpQEBgxne1UHvRlANdf9mscrmbnHMshHwk/PyYm2KYIQKJpSySiLnSM EaX76O+E7aYGvFrJb8riYRT1i6M9X6yUv577gzM+1GGvazaU1vXdT/qIvbW+jQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1665599936; a=rsa-sha256; cv=none; b=aZilX+2lYobqlLtdtv3enT3+DZFt/SvWITUxh6UX82trM2jnQ6h4ApJ7G0n5YVw1ZnVZTk RImcLld4aNQr9fxyazxaAIMSo3RZKuXz8fNws1xod+3SbYytSW+RsZx6CcQH6ZNL8S/b9k p9p8tMFXUTR3BzpjI3ewmRDh86bMwk94MSqsyWCYnpz5EMVxGGRYBwUxSy8tOPNSZpXRK+ 2AQ6BT7zMnuLX1+DMJ47AzkXbSNEwpiyBdrW9ROo0rAW2gSVj0Dge1Bqt+pBLkQ+CruE1K wYZSbjHwcjkbJLdSvozzc929CCs7GV+SLf4FeMUHA9XUQ8xnOpGjFvqGT0OSuQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=lPftW3L3; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=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: 6.10 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=lPftW3L3; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=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: 890273AFC7 X-Spam-Score: 6.10 X-Migadu-Scanner: scn1.migadu.com X-TUID: hZfsRRZPzD5L Am Mittwoch, dem 12.10.2022 um 17:03 +0400 schrieb Andrew Tropin: > On 2022-10-12 20:42, Taiju HIGASHI wrote: >=20 > > Andrew Tropin writes: > >=20 > > > On 2022-10-11 06:21, Liliana Marie Prikler wrote: > > >=20 > > > > 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. > > > >=20 > > > > > > 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. > > > >=20 > > >=20 > > > Current (v5) extra-config has a list type.=C2=A0 This list can contai= n > > > strings > > > and nested lists, string elements are for raw XML, and list > > > elements are for SXML. > > >=20 > > > This is done I guess to support following use case: > > >=20 > > > (list "Already existing XML copied from existing .xml file, > > > which > > > we don't want to rewrite to SXML." > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 '((tag (@ (attr1 "value1") > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 (attr2 "value2")) > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 (nested "Part of the configuration defined with > > > SXML") > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 (empty))) > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "Maybe some other part of= raw XML > > tag>") > > >=20 > > > This way we can combine SXML with already existing raw XML. > > >=20 > > > Am I right? > >=20 > > You're right.=C2=A0 The current implementation allows XML string and > > SXML > > list in the list.=C2=A0 Also, it can mix those. > >=20 >=20 > Ok, that means we can cover this use case, but at the same time have > more functionality, clarity and consistency. >=20 > We can make extra-config to be SXML only (with G-exps support), this > way we will achieve not only the same functionality, but will get > more advanced features like referencing files/directiories in the > /gnu/store or generating parts of configuration using full-fledged > scheme (the simpliest example is just reading the content of the > existing file-like object or using format to generate "raw XML" and > insert it in arbitrary place of SXML tree). >=20 > --8<---------------cut here---------------start------------->8--- > (list #~"Already existing XML copied from existing .xml file, > which > we don't want to rewrite to SXML." > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 `((tag (@ (attr1 "value1") > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 (attr2 "value2")) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = (nested "Part of the configuration defined with SXML") > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = ,#~(format #f "=C2=A0=C2=A0=C2=A0 ~a" > #$variable) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = (fontdirs > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 (dirs ,(file-append font-iosevka "/share/fonts"))) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = (empty))) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 #~(call-with-input-file #$(local-file "old= .xml") get-string- > all) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 #~"Maybe some other part of r= aw XML tag>") > --8<---------------cut here---------------end--------------->8--- >=20 > Liliana, Ludo what do you think? I think the mockup implementation is a little unclear. Do you mean that G-Expressions should imply a string that is to be parsed? Because note that gexp->sexp exists and you could likewise #~(sxml->xml #$some- file-in-the-store) imho. Cheers