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 ms0.migadu.com with LMTPS id yBCAOFwD+WHqNQEAgWs5BA (envelope-from ) for ; Tue, 01 Feb 2022 10:54:36 +0100 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 AHG4NVwD+WHkBwAA9RJhRA (envelope-from ) for ; Tue, 01 Feb 2022 10:54:36 +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 096C128BB6 for ; Tue, 1 Feb 2022 10:54:36 +0100 (CET) Received: from localhost ([::1]:39082 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nEpru-0001JR-Pe for larch@yhetil.org; Tue, 01 Feb 2022 04:54:34 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39676) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEprh-0001JC-SM for guix-patches@gnu.org; Tue, 01 Feb 2022 04:54:22 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:48876) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nEprO-00005r-JL for guix-patches@gnu.org; Tue, 01 Feb 2022 04:54:20 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nEprO-0000VB-9W for guix-patches@gnu.org; Tue, 01 Feb 2022 04:54:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53663] [PATCH] gnu: services: Also accept 'undefined in maybe-foo? constructs. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 01 Feb 2022 09:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53663 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Attila Lendvai Cc: 53663@debbugs.gnu.org Received: via spool by 53663-submit@debbugs.gnu.org id=B53663.16437092291907 (code B ref 53663); Tue, 01 Feb 2022 09:54:02 +0000 Received: (at 53663) by debbugs.gnu.org; 1 Feb 2022 09:53:49 +0000 Received: from localhost ([127.0.0.1]:41779 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEprB-0000Uh-0P for submit@debbugs.gnu.org; Tue, 01 Feb 2022 04:53:49 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:52706) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEpr9-0000UT-56 for 53663@debbugs.gnu.org; Tue, 01 Feb 2022 04:53:47 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 984141DD; Tue, 1 Feb 2022 10:53:40 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id y3O71nyLayur; Tue, 1 Feb 2022 10:53:39 +0100 (CET) Received: from ribbon (91-160-117-201.subs.proxad.net [91.160.117.201]) by hera.aquilenet.fr (Postfix) with ESMTPSA id DDAE813D; Tue, 1 Feb 2022 10:53:38 +0100 (CET) From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20220131152753.19880-1-attila@lendvai.name> Date: Tue, 01 Feb 2022 10:53:38 +0100 In-Reply-To: <20220131152753.19880-1-attila@lendvai.name> (Attila Lendvai's message of "Mon, 31 Jan 2022 16:27:54 +0100") Message-ID: <87ilty6hgd.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: / X-Rspamd-Server: hera X-Rspamd-Queue-Id: 984141DD X-Spamd-Result: default: False [-0.10 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; SUBJECT_HAS_QUESTION(0.00)[] 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=1643709276; 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; bh=BJ7yuZvlTdCNgplhFrCEULS+DURgPvWylMe5DViHGJo=; b=VBoxBl6NzmWe4QhdaPi9yqnVV3sMms/gIG3uYcoFeTKFSfRIoCKoi7Fr1pvj9TRjwBKZTH o23mywUVGgbvH8oLy+uF2/ee4wNEqFL8p3LuT/GHu+q/z94g/ftbTVi/8HkO/yWtT36wlb 0b1mty4A24ZAz63ovO3cPsOw1uyq90uGUsO/Yd0YjrPUabUdQwdZlfl/dWQ/e4GtF+cl6R d+19iUq5i5qD9UZOGz9pJfd7h8HrDllqI3aCTOQJS9f0bS2eWbrrGe7v3qqnrgF/n0S7Ox YODbUFNnyFgDyFn/iJo+CKAh4q/fChZHEkuvbnMfzHUQFixoUZtrKwUf1c3yGg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1643709276; a=rsa-sha256; cv=none; b=MaMKm+W5y1YZI/2icMbTfnc73hkcWtnq4tRI6U1/vhsXAhswGGMWXRUDfNv/OynrPHHUOo AkJGqchjtCaSD7Ad5YpNT2wFUxS9LqUIKKRjl1XPgBWAqDhFCjljKcXSTwJMznQc/9hNm6 ZzNarJBvqrJvwCEI/D2RJY71MXQn/oPen3irdPfuDRqi0NKL+SORpmGkHCYsvcgWjmwGsF DsFWoZidBRo8BIZa8aHGDy1Vw1JjzcezR4V/xBBifJx+4i2fNccQp6Y0l6KJlX7Ly9xwic qgxqWedOGGPehtsGZx4pIux7/3kY+47NZBoPVxj/LFh0FtP56V634TTk9GPLEw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; 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: -3.63 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; 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: 096C128BB6 X-Spam-Score: -3.63 X-Migadu-Scanner: scn1.migadu.com X-TUID: 5ulOjrKG8cK5 Hi! Attila Lendvai skribis: > This is a temporary bandaid until a more explicit handling of maybe types= is > introduced for configurations (e.g. by using srfi-189). Until then, with = this > change it becomes possible to have definitions like: > > (define-maybe string (no-serialization)) > > (define-configuration my-configuration > (my-field (maybe-string)) > (no-serialization)) > > i.e. without providing a default value for MY-FIELD. > --- > gnu/services/configuration.scm | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/gnu/services/configuration.scm b/gnu/services/configuration.= scm > index 0de350a4df..c5f276eab5 100644 > --- a/gnu/services/configuration.scm > +++ b/gnu/services/configuration.scm > @@ -141,7 +141,9 @@ (define (define-maybe-helper serialize? prefix syn) > (id #'stem #'serialize-maybe- #'stem= )))) > #`(begin > (define (maybe-stem? val) > - (or (eq? val 'disabled) (stem? val))) > + (or (eq? val 'disabled) > + (eq? val 'undefined) > + (stem? val))) My understanding is that 'disabled is here precisely to allow users to not provide a value, in which case the generated configuration file will not contain anything for that field. What would be different here? Thanks, Ludo=E2=80=99.