From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id wE94Hb8jgWAhagAAgWs5BA (envelope-from ) for ; Thu, 22 Apr 2021 09:20:31 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id iLtIGb8jgWCxZQAA1q6Kng (envelope-from ) for ; Thu, 22 Apr 2021 07:20:31 +0000 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 0B87910085 for ; Thu, 22 Apr 2021 09:20:31 +0200 (CEST) Received: from localhost ([::1]:60278 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lZTdW-000564-1C for larch@yhetil.org; Thu, 22 Apr 2021 03:20:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56774) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZTd5-00053p-GY for guix-devel@gnu.org; Thu, 22 Apr 2021 03:20:03 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:43246 helo=mail.yoctocell.xyz) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZTd3-0005tl-91 for guix-devel@gnu.org; Thu, 22 Apr 2021 03:20:03 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1619075997; bh=gvLa+69h82FjrrAK8tQz09yB1tHwW87jZQpfmBXXa4U=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=UIQEoCS43+ZTA5N/V36SJjSUg8MTxKFwTtB3ZIzsj8Aa52NpdaiYRqTon+Py8jVH5 TNpxxdPPJXF2KdyosJrI/3q5ack3oSvnJ0NAE7dS0tACDzIPUglVWhofMCEi9bUmEK f7xrP3S6b2MqXFaoWZpZN1sEd6nBKBjE15B5pOLk= To: raingloom Subject: Re: Best practices for writing services In-Reply-To: <20210422001052.4b8c17ec@riseup.net> References: <878s6kqydj.fsf@yoctocell.xyz> <87wnswcmxi.fsf@gmail.com> <87k0ov7w72.fsf@yoctocell.xyz> <20210422001052.4b8c17ec@riseup.net> Date: Thu, 22 Apr 2021 09:19:56 +0200 Message-ID: <871rb27plv.fsf@yoctocell.xyz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=87.96.130.155; envelope-from=public@yoctocell.xyz; helo=mail.yoctocell.xyz X-Spam_score_int: 11 X-Spam_score: 1.1 X-Spam_bar: + X-Spam_report: (1.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, FROM_SUSPICIOUS_NTLD=0.224, PDS_OTHER_BAD_TLD=2, RDNS_DYNAMIC=0.982, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: guix-devel@gnu.org, Maxim Cournoyer Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1619076031; 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=BWc18VhTylKRlwWdzkK4zfmhT3XZacp4wusstoYkz9Q=; b=i12jHAfBUVP9rv9DqpxLbwh+sHb1wjo2BBkKsKsBlmjdf1QNT9LQS/dGyOhMNplQBkN4aN 2TvQ3hkRCaYW8jtNupJhpbCGnJqcwrROg61+Rk0oaQmC3/wCXC6+7l7kX/vg4DMj21VnIk tN2tvV9kddZibZ8Mik/nn6uzlBsBXRMsHF8MGE5ZbJsoQkghxo3Hl7Q9nYufGMmP8FuSoM q5CzFftbpUZjhaYQ3ZSGJkvuC5SRJwQ+fJgxbNxImm/pA/jPImV0ykTMUd4v3aKv1g6brF 3xt93VNn0DRiwLv49PsKReCelinWnk3moS7lee92pvg3Wa8Q5i7NB5Z0+sZO3g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1619076031; a=rsa-sha256; cv=none; b=ITUg8f43mPKWHvHofnt281olXDWBSI5WZ3ebjRph7vpCkB2LWKxkbupxPPQfsl3uTiau/6 Zb125oEEHg0x+Z77g8ptNfso8k9caTE1y/NCCcCEDcf9ghSOXQlJTg1jKqUSff9u4W1+tN 8E4DjZMNTlHcThfUMYdiAcIBIEowPtQV7972XdtFQn8uAFnKLHDNNEzlS2tTljRI9xjosi qGXRoF/4CEAoR3xd42PoOHQi0x+tnQkzOsZ8JB4ioaGhepVJaO9BGUv0xh+M+xIlaMHYHW xW8Tpvs48Ej+OsMruE+jgWgZbzbO589W9ZtM/aqihgAknQjfJMIpbiLtvghLww== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=yoctocell.xyz header.s=mail header.b=UIQEoCS4; dmarc=pass (policy=none) header.from=yoctocell.xyz; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Spam-Score: -3.14 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=yoctocell.xyz header.s=mail header.b=UIQEoCS4; dmarc=pass (policy=none) header.from=yoctocell.xyz; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Queue-Id: 0B87910085 X-Spam-Score: -3.14 X-Migadu-Scanner: scn0.migadu.com X-TUID: QuE8XiWl6ul6 On Thu, Apr 22 2021, raingloom wrote: >> One thing that I find a little annoying is that you have to specify a >> default value for the fields. > > Are you sure? If you don't specify a default, won't the user just be > forced to write > (service whatever > (whatever-configuration > (mandatory-field 'bleepbloop))) > > instead of the shorter (service whatever)? If I write something like this #+begin_src scheme (use-modules (gnu services configuration)) (define (serialize-list field-name val) "") (define-configuration test-config (config (list) "configuration for test")) #+end_src and evaluate it, I will get an error. I have to specify a default value for the =E2=80=98config=E2=80=99 field to make it work. #+begin_src scheme (use-modules (gnu services configuration)) (define (serialize-list field-name val) "") (define-configuration test-config (config (list '()) ;default to '() "configuration for test")) #+end_src