From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 92miG28SL1/+OAAA0tVLHw (envelope-from ) for ; Sat, 08 Aug 2020 21:00:31 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 4A8NF28SL18/DgAAbx9fmQ (envelope-from ) for ; Sat, 08 Aug 2020 21:00: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 F17599403D6 for ; Sat, 8 Aug 2020 21:00:30 +0000 (UTC) Received: from localhost ([::1]:55206 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k4Vx7-0004lT-Sx for larch@yhetil.org; Sat, 08 Aug 2020 17:00:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44170) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k4Vwu-0004kt-AP for help-guix@gnu.org; Sat, 08 Aug 2020 17:00:16 -0400 Received: from box.euandre.org ([46.101.160.115]:45977) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k4Vwr-0005Rl-Fs for help-guix@gnu.org; Sat, 08 Aug 2020 17:00:15 -0400 Received: from authenticated-user (box.euandre.org [46.101.160.115]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by box.euandre.org (Postfix) with ESMTPSA id 24C97FC04F; Sat, 8 Aug 2020 18:00:09 -0300 (-03) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=euandre.org; s=mail; t=1596920411; bh=8xwznzOw1fzRJsE8IL3Z7E1+vhlW5tdb5ymbnBqm5nA=; h=From:To:Cc:Cc:Subject:In-Reply-To:References:Date:From; b=hA7A+Ae6FlDH9P2w1tGItlXPY1XK+981JfnzqWslMHt6MiwtnKvi78glXCRhN+gat AySq0wqZPoyrvMsovulEBowaBHWBeUuZsnaAAAkcRLRpmdRv3WPQSZ7guR7QCjnvZX c5l02lV7dgNhF6VUSDWNnw2H3bWiMvbf+j8h19JRv3uQ32WPBL5d3UkdRek14OrQS0 +fkKAZvbb26Q0CkHumkqIncwHes9ekNEJRAtT54lh8kpgDnnt3lOdUk7dz4GaBWqCf RiQnGnmYp22NjnvHdy1CeKyfQY825g51OrNLe83z839FgequqSuCJoSzqFQ8WsBHzA 8otgvrjLkBvEA== From: EuAndreh To: Tobias Geerinckx-Rice Cc: help-guix@gnu.org Cc: Subject: Re: How to select git:send-email output in config.scm? In-Reply-To: <87ft8xm29l.fsf@nckx> References: <875z9txy8n.fsf@euandre.org> <87o8nlml9y.fsf@nckx> <87364xxm5u.fsf@euandre.org> <87ft8xm29l.fsf@nckx> Date: Sat, 08 Aug 2020 17:53:58 -0300 Message-ID: <87wo28x3ix.fsf@euandre.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=46.101.160.115; envelope-from=eu@euandre.org; helo=box.euandre.org X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/08 17:00:11 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Scanner: scn0 X-Spam-Score: 10.00 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=euandre.org header.s=mail header.b=hA7A+Ae6; dmarc=fail reason="SPF not aligned (relaxed)" header.from=euandre.org (policy=quarantine); spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Spam: Yes X-TUID: EDcPip3W8Uuc Tobias Geerinckx-Rice writes: > Indeed, my first mail was too hurried & my longer mail didn't=20 > address this part at all... > > (packages > (append > (list (list git "send-email") > (list git "gui") ; just another example > foo > ...) > (map specification->package > '("git" > "bar" > ...) > > PACKAGES takes a list of, well, packages -- *or* (package output)=20 > sublists! This is not well-documented: it's mentioned in=20 > gnu/system.scm, but not in the manual under =E2=80=98operating-system=20 > Reference=E2=80=99. I will add it there. Thank you for pointing it out. Thanks for the explanation, now I could make it work. > If you want to go one step further, get rid of APPEND, and MAP=20 > everything: it's not hard to write a procedure similar to=20 > specification->package+output that returns a list instead of=20 > multiple values (hint: take a look at DEFINE-VALUES). There might=20 > well already be one hiding somewhere. I don't know. > > For today, at least, I'll leave this as an excercise for the=20 > reader. :-p Challenge accepted! :) I was able to put handle both cases with a single function. I wasn't able to get rid of map, though. Here's what I got so far: --8<---------------cut here---------------start------------->8--- (use-modules (gnu) (srfi srfi-1)) (operating-system (packages (append (map (lambda (spec) (if (not (string-contains spec ":")) (specification->package spec) (let ((spec-pair (string-split spec #\:))) (list (specification->package (first spec-pair)) (second spec-pair))))) '("git" "git:send-email")) %base-packages)) ...)) --8<---------------cut here---------------end--------------->8--- Any suggestions?