From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id sB5nLizZhGQmSQEASxT56A (envelope-from ) for ; Sat, 10 Jun 2023 22:12:28 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 2JE2LSzZhGRsjQAAG6o9tA (envelope-from ) for ; Sat, 10 Jun 2023 22:12:28 +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 290BC24CEB for ; Sat, 10 Jun 2023 22:12:28 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q84wN-00084N-Ku; Sat, 10 Jun 2023 16:12:03 -0400 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 1q84wM-000833-5r for guix-patches@gnu.org; Sat, 10 Jun 2023 16:12:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q84wL-00059v-TU for guix-patches@gnu.org; Sat, 10 Jun 2023 16:12:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q84wL-0006pE-P8 for guix-patches@gnu.org; Sat, 10 Jun 2023 16:12:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63985] [PATCH RFC v2 1/5] services: configuration: Simplify normalize-extra-args. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 10 Jun 2023 20:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63985 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63985@debbugs.gnu.org Cc: Bruno Victal Received: via spool by 63985-submit@debbugs.gnu.org id=B63985.168642787626160 (code B ref 63985); Sat, 10 Jun 2023 20:12:01 +0000 Received: (at 63985) by debbugs.gnu.org; 10 Jun 2023 20:11:16 +0000 Received: from localhost ([127.0.0.1]:36369 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q84vc-0006ns-4O for submit@debbugs.gnu.org; Sat, 10 Jun 2023 16:11:16 -0400 Received: from smtpm4.myservices.hosting ([185.26.105.235]:38800) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q84vY-0006nh-Ew for 63985@debbugs.gnu.org; Sat, 10 Jun 2023 16:11:15 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm4.myservices.hosting (Postfix) with ESMTP id 367DF20D88 for <63985@debbugs.gnu.org>; Sat, 10 Jun 2023 22:11:10 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 6654180097; Sat, 10 Jun 2023 22:11:10 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id HWA0I_4yl2JV; Sat, 10 Jun 2023 22:11:10 +0200 (CEST) Received: from guix-nuc.home.arpa (unknown [10.192.1.83]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id E2C0A80060; Sat, 10 Jun 2023 22:11:09 +0200 (CEST) From: Bruno Victal Date: Sat, 10 Jun 2023 21:10:52 +0100 Message-Id: <23a11829a71737c7b7041fb47ea0b8a8431a698b.1686427611.git.mirai@makinata.eu> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1686427948; a=rsa-sha256; cv=none; b=p9XtlSU3cqBkPZf7khf2ze7TVtIR0fVJUOuJ26ahM22cvySgvBOAuVhv3Pk9GI5RctjEpm NE1E6BB5JWy+IV13JeCk2TvUqMAHysSu8mNKUmrbD0oswSWI2l8ZbKtYsXDMHsH56hky4V yQKUaFELTv/HL2ujDwAlKy7KBzqqBtK4Z/jWIBbIqFCcZ0P+KQYsvHGF/kpU0PI83JKZq4 2jm9uXiOsRUpHi7ZwJya90C1nHPIQMAo/OnO1F/Z+Jp8Hg9LvlcCHFnGmkPGpMF6hFQErD 71QDbWo8C5y39IUnJhIalBtbANmZkYjTGxLezfh3mc2R+JZeZO8ByZXjb1jD8A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1686427948; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: 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=7bn4gieITkM5/9m/CFZXT+wUjnw5xaQqjZcU5l62278=; b=hMXtBPJGqKjPzN/n9PS/vQV/abur2oU2cIEkjeQE5nW6EtDXOVlXjHzaY9pqn6W8zVYK6o DJ66opxl3+Ja9NjOx0qgcaSTcmcJwDcGmzK2zl7S5repvf6HPa0gz2gJM6KN+d4Ja0N5PC bUesrizCAnfgcBNmm2sn63hMrBe3MR5w5/bQ6slsxuzxEWgtXXswfzp7WB7SwDNClzmfmr OGSxa3TJh5zsGcQ4sqbu2V9Gqlz+ISUhDQzY8o0aNyYVB2VY0VzeSWY994nMeoMB7IhZZs lX/DagseGBEd09wn00HaHLpfhkggsfRz+aWLIWo38EPliYoDhK7a30z8yiXIxA== Authentication-Results: aspmx1.migadu.com; dkim=none; 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-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -2.21 X-Spam-Score: -2.21 X-Migadu-Queue-Id: 290BC24CEB X-TUID: IBBi4SO5NggF * gnu/services/configuration.scm (define-configuration-helper, normalize-extra-args): Use #f instead of %unset-value. --- Notable changes since RFC v1: * Jami service now passes tests. * Typo fixes. * serializer-kwargs renamed to serializer-options. * Changed INI example to something more innocuous. gnu/services/configuration.scm | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/gnu/services/configuration.scm b/gnu/services/configuration.scm index 367b85c1be..dafe72f4fe 100644 --- a/gnu/services/configuration.scm +++ b/gnu/services/configuration.scm @@ -190,32 +190,32 @@ (define (define-configuration-helper serialize? serializer-prefix syn) (define (normalize-extra-args s) "Extract and normalize arguments following @var{doc}." (let loop ((s s) - (sanitizer* %unset-value) - (serializer* %unset-value)) + (sanitizer* #f) + (serializer* #f)) (syntax-case s (sanitizer serializer empty-serializer) (((sanitizer proc) tail ...) - (if (maybe-value-set? sanitizer*) - (syntax-violation 'sanitizer "duplicate entry" - #'proc) + (if sanitizer* + (syntax-violation 'sanitizer + "duplicate entry" #'proc) (loop #'(tail ...) #'proc serializer*))) (((serializer proc) tail ...) - (if (maybe-value-set? serializer*) - (syntax-violation 'serializer "duplicate or conflicting entry" - #'proc) + (if serializer* + (syntax-violation 'serializer + "duplicate or conflicting entry" #'proc) (loop #'(tail ...) sanitizer* #'proc))) ((empty-serializer tail ...) - (if (maybe-value-set? serializer*) + (if serializer* (syntax-violation 'empty-serializer "duplicate or conflicting entry" #f) (loop #'(tail ...) sanitizer* #'empty-serializer))) (() ; stop condition (values (list sanitizer* serializer*))) ((proc) ; TODO: deprecated, to be removed. - (null? (filter-map maybe-value-set? (list sanitizer* serializer*))) + (every not (list sanitizer* serializer*)) (begin (warning #f (G_ "specifying serializers after documentation is \ deprecated, use (serializer ~a) instead~%") (syntax->datum #'proc)) - (values (list %unset-value #'proc))))))) + (values (list #f #'proc))))))) (syntax-case syn () ((_ stem (field field-type+def doc extra-args ...) ...) @@ -239,11 +239,11 @@ (define (define-configuration-helper serialize? serializer-prefix syn) default-value)) #'((field-type def) ...))) ((field-sanitizer ...) - (map maybe-value #'(sanitizer* ...))) + #'(sanitizer* ...)) ((field-serializer ...) (map (lambda (type proc) (and serialize? - (or (maybe-value proc) + (or proc (if serializer-prefix (id #'stem serializer-prefix #'serialize- type) (id #'stem #'serialize- type))))) base-commit: 767edbb6fe781d19c19971f2ccd3b0da8fd053fc -- 2.39.2