From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id EG5cByVORGKRVwEAgWs5BA (envelope-from ) for ; Wed, 30 Mar 2022 14:33:41 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id yPbrBCVORGIKPgAA9RJhRA (envelope-from ) for ; Wed, 30 Mar 2022 14:33:41 +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 830F5107A4 for ; Wed, 30 Mar 2022 14:33:40 +0200 (CEST) Received: from localhost ([::1]:60594 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nZXW7-0003lE-MB for larch@yhetil.org; Wed, 30 Mar 2022 08:33:39 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47078) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nZXUz-0003jU-Tg for guix-devel@gnu.org; Wed, 30 Mar 2022 08:32:34 -0400 Received: from mail-4317.proton.ch ([185.70.43.17]:60745) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nZXUu-0002cm-I8 for guix-devel@gnu.org; Wed, 30 Mar 2022 08:32:29 -0400 Date: Wed, 30 Mar 2022 12:32:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lendvai.name; s=protonmail3; t=1648643532; bh=cVF+SMwOF6wfDYE2GTP23HLKZMLGcYChtP1PBduG8P0=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID; b=VtZ3cwx9ym7w0+05qMSzJ2GGVPiEfcK5bOR+KeB7zsysIJCQa9FM7uHuC4EM1x3xM Pm+C9VibO/Ab+S1JP9rAqMKIOi1KRnUBzphMTinth2XO33mU6xtXKU3EwD0p+6SB9F 4mtotZ70mQgVjjKJI6kiwKv7FJ3Q6Mzv8kUUwzlKuC4SEbjuN6iMtt/QdBVDP6sm6/ 9pPkE+dtEcN6IZC8ClR3cZkitHVTvIQs5xn84trk4H9+o9jniGbAFDpnTl3TlQlNjX BlPsrf2M1J/SwvPSCZ0y/cQ1DoD1/k4Wh82joitWxPl2HhFh4GEZ0AuL+8OMnW/+Ga gsySMkt1OqF2Q== To: Maxime Devos From: Attila Lendvai Subject: Re: using srfi-189 in (gnu services configuration) Message-ID: In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.70.43.17; envelope-from=attila@lendvai.name; helo=mail-4317.proton.ch 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, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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: , Reply-To: Attila Lendvai Cc: guix-devel Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1648643620; h=from:from:sender:sender:reply-to: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=cVF+SMwOF6wfDYE2GTP23HLKZMLGcYChtP1PBduG8P0=; b=NRNhL5J8h/VhjDd6H0Sas4Qca1HdEnTpXlaK8LbH4Weif7oKMM6xfHeKQN3aOeAyNS1qlt P58/Qw6VR1IH5h8Gu9hpprhcmwK7Wal7iuR67h+XwLjvRfkDVEDpufypw/Rc1R6u/qj/DC qsQBp6RSbgw9YC8m2kPhoWaAAg3BWfIBDhqT1WsZib0zXrDBPMqULPnoWs6evoSjDHCu1u yNwlTnGZ3qJqkIQgXfwkfo38R5ubo+sChvXMMhwzek7mt0yUf8nPU4ZbC5ZdP5B5dSAiCD kZJnvOEZx+hL/ZsYF8VJwEZJjg9gPu9NhevfwKnt4n3UgQQ3Ao4FhCoJQiSfew== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1648643620; a=rsa-sha256; cv=none; b=DZFSmqjXoxdnl1zlMmTTz2yR19Os5g5VmmORwmDThbUEyUts1++sEbh5csqcM1hzbQgc8H mw8trOEZXrmgTQa4aLKDl3/Geyj0r/3vaLphIOyk14xCcorUSzzKpyxqxHtlen3l1u2Hzg pVfJoPta9GUL1pZAi/2PJjWxULvAcGxnbpYAjxEG+nwzzTABMEfcnfY5XcridmSxJ5hhie BLTYEoRhvCNS0PyHJs7RyuDjOQHDwxC5zE5/m8wT/xrpXhEcw5wdcIzcqgbvsbumLoJkza sQ6PvxcN9aFjM+VcmzIhhO/r+G+Ks/7g5mjAEGQw+T9tcNKJEkJF6Aj6KTMIhg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lendvai.name header.s=protonmail3 header.b=VtZ3cwx9; 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: 0.33 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lendvai.name header.s=protonmail3 header.b=VtZ3cwx9; 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: 830F5107A4 X-Spam-Score: 0.33 X-Migadu-Scanner: scn0.migadu.com X-TUID: 4urZxVHqKFob > > - the current code uses the symbol 'DISABLED > > It's a bit of a distraction to the discusses issue, but in Guile > Scheme, symbols are case-sensitive, so (not (eq? 'disabled 'DISABLED)). to clarify: i'm using uppercase here only to discriminate scheme symbols from a free-flowing english text. it's common practice in the CL world, but i've also seen it in the Guix docstrings. > This does not appear to be true, at least for (srfi srfi-9) records: > > the following code can put unspecified in Guile records without any > errors: > > (use-modules (srfi srfi-9)) > (define-record-type > (make-foobar foo) foo? (foo foobar-foo)) > (pk 'foobar (make-foobar unspecified)) > ;;; (foobar #< foo: #>) my apologies for stating something with confidence that is not true! i have vivid memory of having tried to use *unspecified*, and getting errors from record accessors, but i cannot reproduce it now. maybe i did something with UNDEFINED?, but i don't even see now how to get hold of that value. anyway, i'll try to patch up (gnu services configuration) to use *unspecified* instead of 'DISABLED, and i'll report back with the end result it it's worthy of that. > Anyway, even if unspecified causes problems, this can be resolved by > introducing a new constant like unspecified or the symbol 'disabled', > but without the potential confusion with a symbol. E.g.: > > (define-values (unset-configuration-value unset-configuration-value?) > (let () > (define-record-type > (make-unset-configuration-value) unset-configuration-value? > unset-configuration-value?) > (values (make-unset-configuration-value) > unset-configuration-value?))) it's not really relevant now, but this is pretty much what srfi-189 does, but as a documented standard. > srfi-189 is also an option, but it seems to me that Haskell-style > Maybe/Just/None that would require lots of wrapping and unwrapping > which seems a bit tedious to me -- doable and definitely an option, but > potentially tedious. i'm afraid about that, too, but i cannot say before i start implementing it. and i think the config code will be equally littered with (if (unspecified? ...) ...) forms, as opposed to (maybe-ref ...) forms when using srfi-189. > Additionally, for your Swarm example, would something like the > following work: this is an excellent idea! (namely, to capture the settings of various swarms into instances, and then predefine the two well-known swarms) i'll implement this first, and only move on to the config stuff afterwards. thanks again Maxime, -- =E2=80=A2 attila lendvai =E2=80=A2 PGP: 963F 5D5F 45C7 DFCD 0A39 -- =E2=80=9CHe alone is great and happy who fills his own station of independe= nce, and has neither to command nor to obey.=E2=80=9D =09=E2=80=94 Johann Wolfgang von Goethe (1749=E2=80=931832), 'With the Iron= Hand' (1773), Act I