From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH 3/5] build: Add 'emacs-build-system' Date: Sat, 27 Jun 2015 11:59:10 +0200 Message-ID: <87d20h321d.fsf@inria.fr> References: <87twu06bhk.fsf@gmail.com> <87si9jsjyj.fsf@gmail.com> <87mvzqr623.fsf@gmail.com> <87mvzoge6x.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]:37726) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8mtN-0002sn-A0 for guix-devel@gnu.org; Sat, 27 Jun 2015 05:59:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z8mtH-0007gb-Hq for guix-devel@gnu.org; Sat, 27 Jun 2015 05:59:21 -0400 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: Federico Beffa Cc: Guix-devel , Alex Kost Federico Beffa skribis: > On Thu, Jun 25, 2015 at 2:33 PM, Ludovic Court=C3=A8s wrot= e: >> Federico Beffa skribis: [...] >> The problem is that this forcefully introduces bindings in an opaque way >> (that is, regardless of whether the =E2=80=98outputs=E2=80=99 binding ap= pears in the >> source, there=E2=80=99s an =E2=80=98outputs=E2=80=99 binding that magica= lly appears; this is >> =E2=80=9Cunhygienic=E2=80=9D or =E2=80=9Cnon referentially transparent,= =E2=80=9D or just =E2=80=9Cbad=E2=80=9D. ;-)) >> >> Ideally, the identifiers that appear in the macro expansion should >> either be in the source, or be unique (compiler-generated.) > > I was so sure that you would say so, that I did a copy of the file > before removing the 'let's and introducing the syntax. :-) > If this would be proposed as a general utility, then I would agree > with you. But it's not. It is a module internal implementation detail Sure, sure, but the problems here are not theoretical. The possibility of having one user introduce a binding that clashes without noticing is real, and it can be hard to debug. =E2=80=9CBut it=E2=80=99s all internal = in a single file,=E2=80=9D right, but some future hacker might not notice the unhygenically-introduced bindings. Simply put, people may not expect such issues to arise in Scheme, so it=E2=80=99s best to not violate the rule of least surprise, IMO. >>> + (filter (lambda (p) >>> + (and (pair? p) >>> + (emacs-package? (package-name->name+version (first p)= )))) >> >> (match-lambda >> ((label . directory) >> (emacs-package? (package-name+version directory)))) >> >> (Which means the =E2=80=98first=E2=80=99 above should have been =E2=80= =98second=E2=80=99?) > > I'm not sure I understand your comment: > 'package-name->name+version' takes a package name, therefore I pass it > the 1st element of each input. The first element of an input is a label, which often happens to be a package name, but doesn=E2=80=99t have to. Would it be possible to extract= the package name from the directory name? > (By the way, 'match-lambda' appears not to be documented in Guile.) Oops. > From e24d0b11280f4fcd106f371b98b7481f7c044eb0 Mon Sep 17 00:00:00 2001 > From: Federico Beffa > Date: Sun, 21 Jun 2015 10:10:05 +0200 > Subject: [PATCH 3/5] build: Add 'emacs-build-system'. > > * Makefile.am (MODULES): Add 'guix/build-system/emacs.scm' and > 'guix/build/emacs-build-system.scm'. > * guix/build-system/emacs.scm: New file. > * guix/build/emacs-build-system.scm: New file. > * doc/guix.texi (Build Systems): Document it. [...] > +(define (emacs-inputs-directories inputs) > + "Extract the list of Emacs package directories from INPUTS." > + (let ((emacs-ins (emacs-inputs inputs))) > + (match emacs-ins > + (((name . dir) ...) dir)))) Minor issue, but I would s/emacs-ins/inputs/, s/dir/directories/, s/name/names/. (See the =E2=80=9CNaming=E2=80=9D section in .) OK to push with changes to this and =E2=80=98emacs-inputs=E2=80=99 as discu= ssed above. Thank you, and sorry for being as predictable and boring as you expected. ;-) Ludo=E2=80=99.