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 2DvnBEmxC2QCOwAASxT56A (envelope-from ) for ; Fri, 10 Mar 2023 23:38:01 +0100 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 0HYUBEmxC2SMMwAAG6o9tA (envelope-from ) for ; Fri, 10 Mar 2023 23:38:01 +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 D0CF21DE6B for ; Fri, 10 Mar 2023 23:38:00 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1palMd-0002Wl-DM; Fri, 10 Mar 2023 17:37:27 -0500 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 1palMa-0002V2-Ou for guix-devel@gnu.org; Fri, 10 Mar 2023 17:37:24 -0500 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1palMZ-0000lo-11; Fri, 10 Mar 2023 17:37:24 -0500 Received: by mail-wm1-x343.google.com with SMTP id c18so4392243wmr.3; Fri, 10 Mar 2023 14:37:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678487839; 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=1fMqvmdf4GkFkKvEvQNeKA50M69BLVUQFXvbtV5mnsU=; b=P6JyBBAFAMM3VxdBcKh0+V9S4jdPHSegAczqnKUswj7Jbp8s4zTHTXqK0D/SiaMyIA MgK8HUsqDhnnpduUnbhS+DRcGStTqCAT8+CXW0XUgE16eeRpJKv7M/5ixhiYkPafT23B Qm8DIEDt+oARrz77fVm2QpgkSL/rcdBAyt8b2YhkAI/ljL7RiTRNO+4I/R00lCiY240s ZcODigzF49FdwSr4X6ILgDW0qWtO1O1DQDVPJd64yFg4wtTFGkDSuZ7DovU+87nzeurE F5+Y9a0ncZXQZzyv3YJqLtUM8xqsTqcCIcWbsG43H9anKoe+ppwnwrP792dKQImpO+lI camQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678487839; 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=1fMqvmdf4GkFkKvEvQNeKA50M69BLVUQFXvbtV5mnsU=; b=oSeXO5xmL+Nwz8w27sfTCbdhOi8S9mRwDss707TqxPoiF4g0AJTVOHUo/HmwK6J7gL Xj8nMZif8bvRO+df9kIP2IQTayhffo/TZdryW5rS5VqkA8nxS5cGCHMfKLXWSEeYnRhU zgv6mDeZ2/8pUSErX1JhGMn/8l4vKIqrKqzeZpx/jk8nzGMPKLN1p/W3B+5aXsV0JkCb hqjli0bL9bxRyLzqut5E3HGhtPTvSmU71P4XyzhLhCyA3ZFCZtm4EkoScLoF+YxYq1Yt 2T4goDsE2Qvj/BMOSGcljxCF8hicByUlvyBioYtBVAbmtTzbchjdhbb9jEMpfPKWun7y Ww/w== X-Gm-Message-State: AO0yUKWCrL3sdSvCs+AQ2+f6R0feFXvYtS1WgmKy2jqb4hZniXwKYEpp EwVT66rimPYn1k32HZmSB6A= X-Google-Smtp-Source: AK7set9cbmQKguvaMZK1X7QI2xP0iUOL03sHwOee+2AIeG7oWtQkoPne7flqS16vLAUyrWVYz+u5Nw== X-Received: by 2002:a05:600c:45cd:b0:3ea:f73e:9d8d with SMTP id s13-20020a05600c45cd00b003eaf73e9d8dmr4471468wmo.32.1678487839366; Fri, 10 Mar 2023 14:37:19 -0800 (PST) Received: from lumine.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id x1-20020adff641000000b002c70c99db74sm824146wrp.86.2023.03.10.14.37.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Mar 2023 14:37:18 -0800 (PST) Message-ID: Subject: Re: Brainstorming ideas for define-configuration From: Liliana Marie Prikler To: jbranso@dismail.de, Bruno Victal , guix-devel Cc: Felix Lechner , Maxim Cournoyer , Ludovic =?ISO-8859-1?Q?Court=E8s?= Date: Fri, 10 Mar 2023 23:37:17 +0100 In-Reply-To: <564d5fb289ca2f547ba89fa8f39b7b72@dismail.de> References: <564d5fb289ca2f547ba89fa8f39b7b72@dismail.de> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.0 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::343; envelope-from=liliana.prikler@gmail.com; helo=mail-wm1-x343.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=P6JyBBAF; 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"; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1678487880; a=rsa-sha256; cv=none; b=Z8WSrQHyPpGnF6sAbqsTEBkxTJUsSq0wOSiyPA4iNY76N8VLx2e8VXiWtpjnl/sidByMul PYaUb3GeOrnAFBDsbZAUGCBA/T9EpoW1fZnef5yXatQsGrt3CkU+r4SrHRJlHPy1ng/0Of 09fqrFzjNmT+QCY78uqnpkZ7QxbciImiRSEiSjOvqRHeVDPhtoOGg4J8PNbwOitt8JtEfP uPIEDnvX7d+8jr+vj4SaKpbr9HfTMtRc0Ig1D9C382inwpnLPVrIZRlPwzGkQk+EGrhb24 j1Rn45PLjOtoJeBBPmYy1iH8K8EmMcjSmQcelMo2t5FKiNpbWFA/8OosSXhIJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1678487880; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=1fMqvmdf4GkFkKvEvQNeKA50M69BLVUQFXvbtV5mnsU=; b=hw2R6g3+yVzgdSET8qm0aFw/YFTukUmi7TeBho1xK9HuC34HFqfyLwF9/+qETa4hgwhNuG qHALDlhzp2W7UpbNh/U8bZpaVPzGiS3+RYO5TAcPPD7JW6CgwR2L1LAtVV+YtAvV4lzn6e DNfrsZLBOcAlve723vfi1nep3Hwe4/YonALv2bO9pn+HuNrM53nVfmOi7NqAdCSWKBZ270 cJowqynRRiX6SCLUvWMye2tee0AWpbZLy5RaEg5thrBXfFttoJ1vFNM0I7K9gAoBpvU+DK eEkQt9yG4lySQ+gOT1p8ZsxhxNRezbbxDv2oQU4guqfsgjtjsIomBgl5BiXIAQ== X-Migadu-Spam-Score: -4.93 X-Spam-Score: -4.93 X-Migadu-Queue-Id: D0CF21DE6B X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=P6JyBBAF; 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"; dmarc=pass (policy=none) header.from=gmail.com X-TUID: sQm06YhSDhkb Am Freitag, dem 10.03.2023 um 20:15 +0000 schrieb jbranso@dismail.de: > While I would agree that a guix service writer should avoid mutually > exclusive fieldnames and instead prefer mutually exclusive records > (and 95% of that time that will work), but may we examine it from a > user's perspective? How does the service writer differentiate from > a string title or string name? >=20 > Suppose that you want to respond to a king's rudeness. You can > secretly insult him or obviously insult him: >=20 > =3D=3D=3DMutually exclusive records=3D=3D=3D, which are better from a > maintainer's perspective, but perhaps cause the user to write more > scheme: >=20 > "..your traitor brother. Maybe I=E2=80=99ll feed him to wolves after I=E2= =80=99ve > caught him. Did I tell you, I intend to challenge him to single > combat?" >=20 > (insult-configuration > =C2=A0 (response > =C2=A0=C2=A0=C2=A0 (secret-insult-configuration > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (secret-insult =E2=80=9CI should like to s= ee that, Your Grace.=E2=80=9D)))) >=20 > OR >=20 > "You can't insult me." >=20 > (insult-configuration > =C2=A0 (response > =C2=A0=C2=A0=C2=A0 (obvious-insult-configuration > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (obvious-insult "We've had vicious kings a= nd we've had idiot > kings, but I don't know if we've ever been cursed with a vicious > idiot for a king!")))) >=20 > =3D=3D=3DMutually exclusive fieldnames=3D=3D=3D >=20 > "I am the KING!" >=20 > (insult-configuration > =C2=A0 (secret-insult "Any man who must say, 'I am the king' is no > true king. I'll show you that after I've won your war."))) >=20 > OR >=20 > "You are Kingsguard!" >=20 > (insult-configuration > =C2=A0 (obvious-insult "...F*ck the King.")))) >=20 > These examples are pretty wonky I will admit, but I really like > an option of having mutually exclusive fieldnames.=C2=A0 Having said all > of this, I will agree that that mutually exclusive fieldnames are a > bit like "goto" in C.=C2=A0 You really should never use them, unless you > absolutely have to. These insult configurations are a little crafted in that the insult- configuration does not have enough fields to make the necessity of a nested field obvious. That is, you could just as easily write (insult-configuration (tone 'obvious) (insult "F*ck the King.")) and look at this record as a "single" value. Note that neither serialization depends on the other. For instance, you can serialize this to XML as=20 F*ck the King. where both fields just need to have their special characters escaped and the serializer for insult-configuration stitch them together via format strings. Obviously, going through SXML would be better, but it's possible. Now, if you wanted to add more metadata, like the location at which you've insulted the king and the time of day, none of which are of interest for the content of your file, but perhaps of interest the medium by which you choose to insult him, it would be better to keep those concerns separate rather than merge them into a single record. Cheers