From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id IDvbHu0i22Hj6gAAgWs5BA (envelope-from ) for ; Sun, 09 Jan 2022 19:01:17 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id uHqEG+0i22FOKAAAauVa8A (envelope-from ) for ; Sun, 09 Jan 2022 19:01:17 +0100 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 0B8353D1C0 for ; Sun, 9 Jan 2022 19:01:17 +0100 (CET) Received: from localhost ([::1]:35302 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n6cVH-0006cg-Rp for larch@yhetil.org; Sun, 09 Jan 2022 13:01:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42158) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n6cU7-0006cV-0S for guix-devel@gnu.org; Sun, 09 Jan 2022 13:00:04 -0500 Received: from [2a00:1450:4864:20::12c] (port=42553 helo=mail-lf1-x12c.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n6cU4-0004Rp-Qa for guix-devel@gnu.org; Sun, 09 Jan 2022 13:00:02 -0500 Received: by mail-lf1-x12c.google.com with SMTP id h2so36391991lfv.9 for ; Sun, 09 Jan 2022 09:59:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop-in.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=P7QAAgGx0LjHAB2c4aOqiSpovrB3ecHZmHghDtsu0gk=; b=F8PoKBZO18nmgiGCw60NZ947fkj7wAtTyytspUsUSESIUvoIck2F/iJDoQ+qs/JNnA fCpY/Faq3jxrwd7nRelhGfZutK22TaMGdMzpE+HTbIOZheILyX6ahHSYZPRuKqbF5sie 0aTWkzVH32LK5tasWhlktby0eqEpQgzpdyZKVNm/d7TwlE6PIbwW4IoW386MbQcX7Lio knLho+V+K37baIGu9YhOr9qUERNjDsqiJB8EosZDr6yNNepyJ38AyhZrAUwQez/XV5fY TCf8jbjW63i+eRDYBicOfreQt1bg7BkW6YIWkbmYGQL5TSuQ/Tsq5PFJpskvURbp8gE1 fAWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=P7QAAgGx0LjHAB2c4aOqiSpovrB3ecHZmHghDtsu0gk=; b=ZXivfgTGYjDziHyC1iH9nLR/yPI7zhh9rvxo8XUS62EFILQDMDl9JSUX+bFKkT55c3 hOak6kNFFU+jy+2AiaQAbMz0EgX23k8k+o/r48nvANafS0Mk+Yp2YWfNd8xsMUkvwRMK vd6NvPfgQmCcSISLCiVnt7a07JEfUWi0eN3ryrdNDEDkIqpU4ndg3syZIBcUAzLBukVP GtrVsKlwmN5AECgwnHc9tSe3Hb9DLqylp0Z2jFI7fsvYS/rTJuFeNptWCftzlk03UyUb LzFvkJXjkLwPqIqsUQHgW20Q8NJEfCGSR3hA9DnpTcgcFOpHXNPju0fuDuN0vOg30vsZ VVYg== X-Gm-Message-State: AOAM532CRpFsliQnZq1bdMMnIm8MVLj2liJuzdEpQ0d1wTumXdS8XMGn cBs1sN4QqonydiTx+oHXiPZLNQ== X-Google-Smtp-Source: ABdhPJyaA2eRw+wdoluUyIaXZRlu7dREDn6JhmlBNWP9cU5j8DJa5LSjJfQgbuocVwbF+HHzhX+5dQ== X-Received: by 2002:a05:6512:3f2:: with SMTP id n18mr3781845lfq.185.1641751197966; Sun, 09 Jan 2022 09:59:57 -0800 (PST) Received: from localhost (109-252-167-227.dynamic.spd-mgts.ru. [109.252.167.227]) by smtp.gmail.com with ESMTPSA id b18sm732641ljf.93.2022.01.09.09.59.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jan 2022 09:59:57 -0800 (PST) From: Andrew Tropin To: Maxime Devos , guix-devel@gnu.org, Oleg Pykhalov , Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: Return back original implementation for text-config serialization In-Reply-To: <0802f1bb7418b0b3458c5beb008f4c8dc6fc120c.camel@telenet.be> References: <878rvp1deg.fsf@trop.in> <0802f1bb7418b0b3458c5beb008f4c8dc6fc120c.camel@telenet.be> Date: Sun, 09 Jan 2022 20:59:54 +0300 Message-ID: <87y23o3i3p.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::12c (failed) Received-SPF: none client-ip=2a00:1450:4864:20::12c; envelope-from=andrew@trop.in; helo=mail-lf1-x12c.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Xinglu Chen , guix-maintainers@gnu.org Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" 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=1641751277; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=P7QAAgGx0LjHAB2c4aOqiSpovrB3ecHZmHghDtsu0gk=; b=t35z4bi4IWjzCmA1KIjdjNFv098rLdDVh9HA3mYV8CPX29v5bFDBU8uh3uow6+9P+c3dbs gcFh/LYdlm0WVQajvD8s0EhwqPOWFm9MdDwYnIFqQKHdxBb+U8I8uQ0scPlV1g/eJPvIdA 4jZsv4AAtgPCvLGLH9xyk4+xWK2mZfESfUiW5O7pIgv6rtlEXyQ8eo7bTWdMrRq+2w9xYh X9Ueezq2QYWEPWbhriheHJ2s3O/5fgSvYaoSFsufhWNVm1H8Gs4mU4JOJ78gJwBA+GDYHB 9LiRZpYo2CW0CYqf3gE3lInpJ8lB3q7jZkX6VV59Pr6W2+xMQQ8/rtEWVOg8ZQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1641751277; a=rsa-sha256; cv=none; b=QTGqGDqMzUbkcUfYgmpfuJOmZZlq/Xei2XwhtPVM4AcHQVNOUyOgV2Bp2oiB4vWnthgDT/ 7ehIk80wMY8Wg51YoBsC4TP52j9Wm8hVOWVOFdBdjuk8l+EWJvD9uylxBtxbAkEDamBwBh VN9W4qFYwbUEL5eOUCEvR0vpVrsOr5s5lISHD92kP0286ieWi5FIDVLRR20UtCiMlTV0mN q5Uca5vXxAPSBeVO+ZjpDwX7L9xEAnsnngfRhGIslj5iZYwulpMKX8RIQT3iE2Aoe0PkGq 83m5AY7N5SrNSlW+qiEcW09BytSIj1BrNApijzr6VA/J79bS2UVNjzrs0EDgfQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=trop-in.20210112.gappssmtp.com header.s=20210112 header.b=F8PoKBZO; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -4.41 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=trop-in.20210112.gappssmtp.com header.s=20210112 header.b=F8PoKBZO; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 0B8353D1C0 X-Spam-Score: -4.41 X-Migadu-Scanner: scn1.migadu.com X-TUID: vgQnM1vhyAaH --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2022-01-09 13:19, Maxime Devos wrote: > Andrew Tropin schreef op zo 09-01-2022 om 12:12 [+0300]: >> [...] There is another less generalized example, which demonstrates >> how >> serialization of sway configuration works right now. >>=20 >> --8<---------------cut here---------------start------------->8--- >> `((include ,(local-file "./sway/config")) >> =C2=A0 (bindsym $mod+Ctrl+Shift+a exec >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ,(file-appe= nd emacs "/bin/emacsclient") -c --eval >> "'(eshell)'") >> =C2=A0 (bindsym $mod+Ctrl+Shift+o "[class=3D\"IceCat\"]" kill) >> =C2=A0 (input * ((xkb_layout us,ru) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (xkb_= variant dvorak,)))) >> --8<---------------cut here---------------end--------------->8--- >>=20 >> would yield something like: >>=20 >> --8<---------------cut here---------------start------------->8--- >> include /gnu/store/408jwvh6wxxn1j85lj95fniih05gx5xj-config >> bindsym $mod+Ctrl+Shift+a exec /gnu/store/...-emacsclient -c --eval >> '(eshell)' >> bindsym $mod+Ctrl+Shift+o [class=3D"IceCat"] kill >> input * { >> =C2=A0=C2=A0=C2=A0 xkb_layout us,ru >> =C2=A0=C2=A0=C2=A0 xkb_variant dvorak, >> } >> --8<---------------cut here---------------end--------------->8--- >>=20 >> The new text-config serialization implementation (after fee0bc >> commit) >> doesn't support gexps and tries to insert the literal content of the >> file in place where file-like object was used, which >>=20 >> 1. Confuses the users. [...] >> 2. Looks strange implementation-wise. [...] >> (mixed-text-file ... >> "source \" "\n" >> #~(read-everything-from-file >> #$(computed-file "unecessary-file-name" >> #~#$(local-file "blabla.sh")))) >> when originally it was >> (mixed-text-file >> "source \" "\n" >> (local-file "blabla.sh")) > > Can we have (mixed-text-file "source \" "\n" (local-file "blabla.sh")) > and the sway configuration you quoted? That syntax seems reasonable > and easy to use to me. But without reintroducing slurp-file-gexp. > > Greetings, > Maxime. I think we can just rely on something like that: =2D-8<---------------cut here---------------start------------->8--- #~(call-with-input-file #$(local-file "./files/bashrc") (@ (ice-9 textual-ports) get-string-all)) =2D-8<---------------cut here---------------end--------------->8--- As I mentioned in reply to Liliana, from my experience it's a rare case, when we really need to slurp the content of the file, in most cases include/source and other similar consturctions can do the trick, so it maybe not necessary to have a helper for this case at all. WDYT? BTW, even after reading "Code Staging in GNU Guix" paper, I still not sure what the problem with slurp-file-gexp (except maybe name :) ). =2D-=20 Best regards, Andrew Tropin --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmHbIpoPHGFuZHJld0B0 cm9wLmluAAoJECII0glYwd6wa44P/j3Qh+J2R+37hzxKm5zqmLmfUZGtuzwBffGW ume5ceTaYQVgHs4rgxCFMLwcCRF2d1RXLtgWnN1cyLvWDy/baCxmcOe5LQyTmeud q0CpXXNmtvKtFfbhtLXUZyxFQSgjLS1lZkgYPJWF7mr1jJSiXIIIgWLFFY3HpjON xx6uVwwPWA6TeDLrXnABwYKh7xNU9I28v/WGWrmq3wbQpH3cL8i1XlUqELJw+b8L gSo3qPov4NNMdpQIpY4u3nm1zn2yLCjLShWIxgKcnhA/MhuN2uRjLKYMTCBD3AEL AGNHt8Wij1TuyPna5l8yriVbmVnhf9hfnx08qw1Gzexk8RflmZZlLfcEBkvQKEJw 3DOQ1iCg1Gyl3QnsjFYiqBciXsaKIpatex4Et+WrHJeyJl1DCUtama0F0bXSOQQD iFacgtX0YvmwbpLFxNgqFnyroXp8Dr7bEjXtcWwZY3BM16F5yL3Pd+pHh5DDd5tV ZzW30BlHAHUfh3X6BJC2zm0gO7N26BiFsZgoSU8alAlHPfRObPdd/TC070JSyCR1 Qa87TbxkzqG+g6stBM+nyNApg9ldSmBSUE61hjoSCzQ8tkN7dnlMgGTU+Cr4GKlq kn/gN0cF/FlBlyMQOWxkoxq/QCRu2EGyFONiTujpp2pQ1dehqnjlPZU2LDC9HP45 XOr1Wjhg =tnmu -----END PGP SIGNATURE----- --=-=-=--