From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH 04/13] utils: Use '@' for separating package names and version numbers. Date: Mon, 29 Feb 2016 17:00:53 +0100 Message-ID: <87ziujecay.fsf@gnu.org> References: <1453666771-16869-1-git-send-email-mthl@gnu.org> <1453666771-16869-5-git-send-email-mthl@gnu.org> <87h9i1evp5.fsf@gmail.com> <8737tl4bve.fsf@gnu.org> <877fiwpayr.fsf@gnu.org> <87k2m0cto5.fsf@gnu.org> <87vb5flm0q.fsf@gnu.org> <87wppo1hso.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38402) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaQFr-00062I-QK for guix-devel@gnu.org; Mon, 29 Feb 2016 11:01:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aaQFl-0004ex-Af for guix-devel@gnu.org; Mon, 29 Feb 2016 11:01:03 -0500 In-Reply-To: <87wppo1hso.fsf@gnu.org> (Mathieu Lirzin's message of "Mon, 29 Feb 2016 01:28:23 +0100") 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.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Mathieu Lirzin Cc: guix-devel@gnu.org, Alex Kost Mathieu Lirzin skribis: > However, I am not pleased by the current state of the > =E2=80=98specification/package-name->...=E2=80=99 procedures. They don't= compose well, > and are obfuscated by being fragmented across a bunch of modules. I > don't know if there is much room for improvement but my feeling is that > the brain involvement required for implementing the '@' thing was far > too high compared to the actual task. The idea is that things that need to traverse the list of packages live in (gnu packages), whereas syntactic helpers leave in (guix ui) and such. This is so that the (guix =E2=80=A6) module are (almost) independent= of the (gnu =E2=80=A6) modules. That said, if you think of improvements, that=E2=80=99d be interesting! > From a39b458002e2c4c36c9adb2718f166b4e5ff7965 Mon Sep 17 00:00:00 2001 > From: Mathieu Lirzin > Date: Sun, 28 Feb 2016 17:50:58 +0100 > Subject: [PATCH 1/2] packages: Factorize package specification search. > > * gnu/packages.scm (%find-package): New procedure. > (specification->package, specification->package+output): Use it. [...] > (define* (specification->package+output spec #:optional (output "out")) > "Return the package and output specified by SPEC, or #f and #f; SPEC m= ay [...] > + (and=3D> (%find-package spec name version) > + (lambda (pkg) > + (if (member sub-drv (package-outputs pkg)) > + (values pkg sub-drv) This fragment can return a single value instead of two. Thus, it should be changed to something like: (match (%find-package spec name version) (#f (values #f #f)) (package ;no need to call it =E2=80=98pkg=E2=80=99 :-) =E2=80=A6)) OK with this change! > From a5d3eb26c06965647d0e1749b848f8501ae61d62 Mon Sep 17 00:00:00 2001 > From: Mathieu Lirzin > Date: Sun, 28 Feb 2016 23:11:36 +0100 > Subject: [PATCH 2/2] * utils: Use '@' for separating package names and ve= rsion > numbers. Extra star in subject. > +*** New syntax for separating package names and version numbers > + > +Use =E2=80=98@=E2=80=99 instead of =E2=80=98-=E2=80=99 as a separator. = This new separator is a reserved ^^ Maybe add: =E2=80=9C, as in =E2=80=98gnupg@2.0=E2=80=99.=E2=80=9D > +character which is not allowed both in package names and version numbers. Maybe add: The old syntax to specify a package=E2=80=99s version=E2=80=94e.g., as = =E2=80=9Cgnupg-2.0=E2=80=94is obsolete and support for it will be removed in the future. OK with changes along these lines. Thanks a lot! This closes another item towards 0.9.1. \o/ Ludo=E2=80=99.