From mboxrd@z Thu Jan 1 00:00:00 1970 From: ison Subject: Re: Parameterized packages Date: Mon, 20 Jan 2020 15:57:22 -0700 Message-ID: <20200120225722.oxg4pbggvir4o24i@n0> References: <87o8v5ukgb.fsf@ambrevar.xyz> <87d0blhr9s.fsf@ambrevar.xyz> <20200116190644.uytvzvypuvdwh2iq@n0> <87d0bfrxr1.fsf@gnu.org> <87tv4qjy06.fsf@ambrevar.xyz> <875zh6rm5h.fsf@ambrevar.xyz> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:56402) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1itfyt-000590-4U for guix-devel@gnu.org; Mon, 20 Jan 2020 17:57:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1itfyr-0000Jm-O1 for guix-devel@gnu.org; Mon, 20 Jan 2020 17:57:14 -0500 Received: from cock.li ([2a06:1700:0:b::c0cc]:57656) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1itfyr-0000Ca-4m for guix-devel@gnu.org; Mon, 20 Jan 2020 17:57:13 -0500 Content-Disposition: inline In-Reply-To: <875zh6rm5h.fsf@ambrevar.xyz> 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+gcggd-guix-devel=m.gmane-mx.org@gnu.org Sender: "Guix-devel" To: Pierre Neidhardt Cc: guix-devel@gnu.org On Mon, Jan 20, 2020 at 07:57:30PM +0100, Pierre Neidhardt wrote: > > The solution of 2. and 3. seems to write, as Ludo mentioned: > > > > --8<---------------cut here---------------start------------->8--- > > (define (make-me-a-package option1 option2) > > (package > > =E2=80=A6)) > > --8<---------------cut here---------------end--------------->8--- Just a thought, but could this be achieved using Guile's parameterization feature? https://www.gnu.org/software/guile/manual/html_node/Parameters.html Not sure which method will be best overall, but its something to consider and might avoid the need to define a bunch of extra functions. So basical= ly all standard parameters could be defined globally using make-parameter, t= hen in the parameters field of the package it lists the parameters they want which will pick up the default values, or be overridden by parameterizati= on. Although I wonder if maybe it's better to not use global defaults for the parameters and just let packages set their own defaults?