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 ms5.migadu.com with LMTPS id 8PqlFCf6i2LCWgAAbAwnHQ (envelope-from ) for ; Mon, 23 May 2022 23:18:31 +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 WIaFFCf6i2JS3AAA9RJhRA (envelope-from ) for ; Mon, 23 May 2022 23:18:31 +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 BFA712E88F for ; Mon, 23 May 2022 23:18:28 +0200 (CEST) Received: from localhost ([::1]:35146 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ntFRc-0000qm-09 for larch@yhetil.org; Mon, 23 May 2022 17:18:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46132) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntFHO-0001jZ-3g for gwl-devel@gnu.org; Mon, 23 May 2022 17:07:55 -0400 Received: from sender4-of-o50.zoho.com ([136.143.188.50]:21065) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntFHM-00080L-9y for gwl-devel@gnu.org; Mon, 23 May 2022 17:07:53 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1653340067; cv=none; d=zohomail.com; s=zohoarc; b=STFqtMe+3reZlllWh+VcMvM1Uy2+2T2DR/qJIxnssknaZBcFZPBTeMwdNsexplVPjSiHy5pmjWxO+yOv8KVG6MWXjg+S8+N+kcYTm1u90AWFkkb81Q+uZvjOENUI0jWnCTVF/s/Fe2sByTXKh3dn8hoBhwVK7kegRL27J3ab7zg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653340067; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=kzfYCfQtLnCdPbRIwz6iZKk8KJvZOXmipZkAyH/LjO8=; b=RcoLh0xsx1aVkR/pZxejmPLoHMq78pRZERh8QCrnXmKcWNcXTwI5+z7xtKKIdi8Rn91v6bCRnBC6sK1p22biZgh0I3NHpRaj5fHC4tPdgYsIw6xmEkSYRyQMz2mIuS90HKHI3fo/07nOUssDHNKAmBcEozvdnZUtYy5hI5KQWXs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=elephly.net; spf=pass smtp.mailfrom=rekado@elephly.net; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1653340067; s=zoho; d=elephly.net; i=rekado@elephly.net; h=References:From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:In-reply-to:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To; bh=kzfYCfQtLnCdPbRIwz6iZKk8KJvZOXmipZkAyH/LjO8=; b=dMDWlRyZIiADjNp5cV4LDIpNQjwayjxdKLrFdlso2cBwE5VNYNKjzIdFkiWVBt6/ UxJdh3qEGLbcr/OKclM5EdaDLb6dIt1crkWP6GO/4afHJZT1RHcZiy0kFhoULKkvzGx LTcvGy9Mk1RDMTpLR43OlRnbaihawieqCuYR3PAE= Received: from localhost (236-111-142-46.pool.kielnet.net [46.142.111.236]) by mx.zohomail.com with SMTPS id 1653340066424779.425194701041; Mon, 23 May 2022 14:07:46 -0700 (PDT) References: <20220429180247.17830-1-olivier.dion@polymtl.ca> <20220522123844.23527-1-olivier.dion@polymtl.ca> User-agent: mu4e 1.6.10; emacs 28.0.50 From: Ricardo Wurmus To: Olivier Dion Cc: gwl-devel@gnu.org Subject: Re: [PATCH v4] packages: Support for full Guix specification Date: Mon, 23 May 2022 23:02:53 +0200 In-reply-to: <20220522123844.23527-1-olivier.dion@polymtl.ca> X-URL: https://elephly.net X-PGP-Key: https://elephly.net/rekado.pubkey X-PGP-Fingerprint: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC Message-ID: <87ee0khs9s.fsf@elephly.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External Received-SPF: pass client-ip=136.143.188.50; envelope-from=rekado@elephly.net; helo=sender4-of-o50.zoho.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, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: gwl-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gwl-devel-bounces+larch=yhetil.org@gnu.org Sender: "gwl-devel" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1653340711; 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=kzfYCfQtLnCdPbRIwz6iZKk8KJvZOXmipZkAyH/LjO8=; b=gLhS8GBmzTUu8WdDwfe4eRcYBhdsSG/3/A9SnaCvi+Jh0OO/SZ+Epp49sW4J1TldBPgeWd jOFK7xj6mxjV6GjwoxbHVj8k8VeRWy5OB40URSg1VbEEkBwG8IGnUBYIq4L0zYpGPlqIbg Si5JW+MnFBWp3UgEgI0KrLOk2Ww5q5y8xTJGa4Irk7bYZJoM20qSWxamZds8B9Ih7Erj4B yIF/5k8mek2+A1V3QaQ3i4mSsuRKE8BLaxVY58Afnze4YyD6+R/EHh9M+nTQaecYfvAE/p Smcrm50ZZj6p4uwBX5QyGKyTovWgXz++M+/Hie5t27Kk71BS4McdC5AnT1VI6w== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1653340711; a=rsa-sha256; cv=pass; b=go/Uo6Z8mbewNV+q1XK0CPxeBEPLfa9x3AcKbS7hnZnFARePegnL7lCvG2AjIVv4Ng7g0h pgEkyL6EarksCvBx9Yw6TLvpUf/8NCKR0DvvlU2+00mAjB70v+4cqPCBaslzGuBMZUpQr/ /LNYrlSk11enskgJwPOWk5xQaj+hJJ71Fu2R26hJK8cWaMEp+8ulDoHF+r2Px2JlhbOmcu brn7RosFZfKaklKRbzLsBDNj49aPPxud+gosDW6X5wQM/0m2YZCYUMwYdUO6T65nAqR4tW xJuA4rKWAMJr11Kn8hj06NlDdCC82nPAFun2MQaCQZERw7M8LmIj8gYe+yFPRw== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=elephly.net header.s=zoho header.b=dMDWlRyZ; arc=pass ("zohomail.com:s=zohoarc:i=1"); dmarc=none; spf=pass (aspmx1.migadu.com: domain of "gwl-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="gwl-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.05 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=elephly.net header.s=zoho header.b=dMDWlRyZ; arc=pass ("zohomail.com:s=zohoarc:i=1"); dmarc=none; spf=pass (aspmx1.migadu.com: domain of "gwl-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="gwl-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: BFA712E88F X-Spam-Score: -3.05 X-Migadu-Scanner: scn1.migadu.com X-TUID: RuE3aPJ+BGLP Hi Olivier, thank you for the updated patch! Using object properties is a neat idea. > @@ -73,11 +77,18 @@ >=20=20 > (define (lookup-package specification) > (log-event 'guix (G_ "Looking up package `~a'~%") specification) > - (match (lookup-inferior-packages (current-guix) specification) > - ((first . rest) first) > - (_ (raise (condition > - (&gwl-package-error > - (package-spec specification))))))) > + (let ((name version output > + (package-specification->name+version+output specification)= )) > + (let* ((inferior-package > + (lookup-inferior-packages (current-guix) > + name version)) > + (package (match inferior-package > + ((first . rest) first) > + (_ (raise (condition > + (&gwl-package-error > + (package-spec specification)))))))) You can merge the SRFI-71 =E2=80=9Clet=E2=80=9D with =E2=80=9Clet*=E2=80=9D= to a single =E2=80=9Clet*=E2=80=9D and thus remove one layer of nested parentheses. > + (set-object-property! package #:gwl/package-output output) The Guile manual has this to say about =E2=80=9Cset-object-property!=E2=80= =9D: Guile also implements a more traditional Lispy interface to properties, in which each object has an list of key-value pairs associated with it. Properties in that list are keyed by symbols. This is a legacy interface; you should use weak hash tables or object properties instead. The preferred way to do this is to define a property, and then use =E2=80=9Cset!=E2=80=9D and the property getter on the object: --8<---------------cut here---------------start------------->8--- (define package-output (make-object-property)) (define* (lookup-package =E2=80=A6) =E2=80=A6 (set! (package-output package) output) ;store the output as a property =E2=80=A6) =E2=80=A6 (package-output package) ; retrieve the output --8<---------------cut here---------------end--------------->8--- --=20 Ricardo