From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Some macros to make package definitions prettier Date: Tue, 03 Mar 2015 21:44:43 +0100 Message-ID: <878ufdretg.fsf@gnu.org> References: <874mqa6iz4.fsf@taylan.uni.cx> <87bnkhzhxd.fsf@gnu.org> <877fv553ss.fsf@taylan.uni.cx> <87y4nkwdxm.fsf@gnu.org> <87wq2ydo1o.fsf@taylan.uni.cx> 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]:57766) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YStgQ-0003BU-BR for guix-devel@gnu.org; Tue, 03 Mar 2015 15:44:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YStgM-0000Yk-CC for guix-devel@gnu.org; Tue, 03 Mar 2015 15:44:50 -0500 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:58936) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YStgM-0000Ye-8z for guix-devel@gnu.org; Tue, 03 Mar 2015 15:44:46 -0500 In-Reply-To: <87wq2ydo1o.fsf@taylan.uni.cx> ("Taylan Ulrich \=\?utf-8\?Q\?\=5C\=22Bay\=C4\=B1rl\=C4\=B1\=2FKammer\=5C\=22\=22's\?\= message of "Tue, 03 Mar 2015 17:49:07 +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: Taylan Ulrich =?utf-8?Q?=22Bay=C4=B1rl=C4=B1?= =?utf-8?Q?=2FKammer=22?= Cc: guix-devel@gnu.org taylanbayirli@gmail.com (Taylan Ulrich "Bay=C4=B1rl=C4=B1/Kammer") skribis: > ludo@gnu.org (Ludovic Court=C3=A8s) writes: > >> I=E2=80=99ve applied it locally and will push shortly. > > It might be too late, but I have a nitpick on my macro: the implicit > quoting of phase names 1. makes it impossible to provide them > dynamically (e.g. procedure argument), 2. might give an illusion that > they're sort of compile-time constants (like the 'delete', 'add-before', > etc. tokens are). > > I guess it's fine since they are literal symbols in pretty much all > cases (or really all cases) so far, but it bothered me so I wanted to > share; it might be best to avoid such implicit-quoting in the future. I actually agree. Well, next round? > Another nitpick would be that standards-compliant syntax-rules won't > match the 'delete', 'replace', etc. literal tokens if they have a > different binding during use than during definition of the macro. (The > identifier is matched by symbol name (i.e. "unhygienically") only if > it's unbound during both definition and use.) But I think this is > really a problem in the Scheme standard, because this kind of macro is > probably ubiquitous in Scheme code "in the wild." (And psyntax usually > does it the way we expect.) In think Guile 2.1 is standards-compliant in that respect though. A related problem will be the =E2=80=98_=E2=80=99 procedure of (guix ui) that= will need to be renamed (which is annoying at worst, but OK.) =E2=80=98delete=E2=80=99 = might be more of a problem. > Regarding the automatic conversion, I'll look into your recommendation, > and also ponder on a hand-baked solution in Guile or Elisp, but I wonder > if it will be possible to cover all edge-cases, especially comments. On > the upside, we can auto-verify the results (sans comments and code > formatting) by comparing package objects for equality before and after > the transformation, since a use of 'modify-phases' should have the exact > same result as the direct alist mangling... Yes, but the package object contains quoted code, so we can=E2=80=99t direc= tly compare them for equality in this case. That said, any problems would be easily spotted I guess. Thanks, Ludo=E2=80=99.