From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id AK8UHjNuIWX9QAAAauVa8A:P1 (envelope-from ) for ; Sat, 07 Oct 2023 16:41:55 +0200 Received: from aspmx1.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id AK8UHjNuIWX9QAAAauVa8A (envelope-from ) for ; Sat, 07 Oct 2023 16:41:55 +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 44E6C3651E for ; Sat, 7 Oct 2023 16:41:55 +0200 (CEST) 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1696689715; 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=mgB34OedBc4FpiGCt255/BezFrUOW14B4za2FCkuFRA=; b=NFJ4sVMq9mBdDY8pVv55MrShGM3XN3SHMxGmxRWl2GMuz/1mVfqjGz/ASqbEcQ+nQrOITi wazL/j21SsDSO++8jC6da0mS8Hd2xJsBAufPtFh1E+L7f0TmlyaNCQuzCv3CJUeq4+Rk+4 mBZQr3aA8/SVLdqZMba3zQ7q/DAwEPV+gMgUwrCHrjEXkMnMCXLreNF+7+TlzLYTLqkhAu O6A5SSMXRCf/IcyVBYJ5hh+S+PCcFq/wXRuxyLRWFAVP7bjHhuAB2gFkbqFMHojyFNHYuL FVi6xOKFcQMS5ulFby3DdSF+h7/yLtU0rTatpSGuBnu3K7OmtVKfPMl809lSNQ== 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-Seal: i=1; s=key1; d=yhetil.org; t=1696689715; a=rsa-sha256; cv=none; b=FdUHraQ6t8uuCwyiM8X0NVmuRZzb8ZBNkmQhcZjOQbID/9KBna2i+TSsNPU3Rislpk25T4 Fj+ecG1gaTqX0jXQ0IkxodZhrfxw/tQoRgpY8b8QfvqXoWVkz4TaJbHwmEYCQsF9tvtzF/ 7eUofJfbSAS2pxpeo4zJ67WqPuqwRSKqWPNRn0seGTQ0/R4o9o/40xB5cRYU0SGShPt4ZY uhmZpFP05EQsS3h2Zugb/fCLUvuo1o7npFhO97+vjJSaMMLwTc5t9+vUafnhrTsduPDt1G fRGLw+RohQ182TZJDFB5wrXN81sQ92dXeRy+WpxnWDhd+5iZomt34CQgj4yMCA== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qp8Uz-0007Nc-6f; Sat, 07 Oct 2023 10:41:45 -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 1qp8Uw-0007NA-Ff for guix-patches@gnu.org; Sat, 07 Oct 2023 10:41:42 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qp8Uw-0004Z6-7k for guix-patches@gnu.org; Sat, 07 Oct 2023 10:41:42 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qp8VF-0005Wb-LY for guix-patches@gnu.org; Sat, 07 Oct 2023 10:42:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63985] [PATCH RFC 0/5] Generic INI serializer & SRFI-171 for define-configuration Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 07 Oct 2023 14:42: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: Maxim Cournoyer Cc: 63985@debbugs.gnu.org Received: via spool by 63985-submit@debbugs.gnu.org id=B63985.169668972021229 (code B ref 63985); Sat, 07 Oct 2023 14:42:01 +0000 Received: (at 63985) by debbugs.gnu.org; 7 Oct 2023 14:42:00 +0000 Received: from localhost ([127.0.0.1]:55622 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qp8VD-0005WK-Kz for submit@debbugs.gnu.org; Sat, 07 Oct 2023 10:41:59 -0400 Received: from smtpmciv2.myservices.hosting ([185.26.107.238]:40082) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qp8VB-0005WA-41 for 63985@debbugs.gnu.org; Sat, 07 Oct 2023 10:41:58 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpmciv2.myservices.hosting (Postfix) with ESMTP id BF38C20DFD; Sat, 7 Oct 2023 16:41:25 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 88D7D80092; Sat, 7 Oct 2023 16:21:51 +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 u9cOZr3zhdOl; Sat, 7 Oct 2023 16:21:51 +0200 (CEST) Received: from [192.168.1.116] (unknown [10.192.1.83]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 046E48005B; Sat, 7 Oct 2023 16:21:48 +0200 (CEST) Message-ID: Date: Sat, 7 Oct 2023 15:21:48 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US References: <3c9e04b336d5627af5167ff3b786918df724f3f6.1687816734.git.mirai@makinata.eu> <87r0mc3mmf.fsf_-_@gmail.com> From: Bruno Victal In-Reply-To: <87r0mc3mmf.fsf_-_@gmail.com> Content-Type: text/plain; charset=UTF-8 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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -6.18 X-Spam-Score: -6.18 X-Migadu-Queue-Id: 44E6C3651E X-Migadu-Scanner: mx2.migadu.com X-TUID: gvg3CCZfg3tg On 2023-10-02 19:28, Maxim Cournoyer wrote: >> +An example of a simple serializer procedure: >> +@lisp >> +(define (serialize-boolean field-name value) >> + (let ((value (if value "true" "false"))) >> + #~(string-append '#$field-name #$value))) >> +@end lisp >> + > > I know this is adapted from old code, but shouldn't there be a "=" in > that string-append, between the field name and its value? […] I think there's no particular meaning for that isolated snippet but I believe the original author did intend for there to be a "=" symbol as you have pointed out. I've went ahead and added the “ = ” (with spaces) variant instead. > […] Also, using gexps here seems unnecessary and may confuse the reader. I don't think so because in general you're going to call `serialize-configuration' which returns a G-Expression so it's more or less given that using G-Expressions is perfectly valid and using them from the outset allows your fields to serialize any kind of value such as package objects (for something like `gcc-path = /gnu/store/…'), etc. Thus, not using G-Exps is more restrictive in terms of what you can serialize. It might not make a difference in some cases but I think this is a potential source of trouble when someone tries to serialize a gexp object with a non-gexp ready serializer. (e.g. performing string-append with a string and a package object) I'm aware of some cases where this is not a problem such as the case where you write your own version of `serialize-configuration' to handle the serialization in some other manner. (perhaps using `list' instead of `string-append' for the final step) Such a case is clearly in the “advanced guix hacker” arena and thus I don't think there's a risk for confusion here. -- Furthermore, I consider that nonfree software must be eradicated. Cheers, Bruno.