From mboxrd@z Thu Jan 1 00:00:00 1970 From: taylanbayirli@gmail.com (Taylan Ulrich =?utf-8?Q?Bay=C4=B1rl=C4=B1?= =?utf-8?Q?=2FKammer?=) Subject: Re: Some macros to make package definitions prettier Date: Tue, 03 Mar 2015 17:49:07 +0100 Message-ID: <87wq2ydo1o.fsf@taylan.uni.cx> References: <874mqa6iz4.fsf@taylan.uni.cx> <87bnkhzhxd.fsf@gnu.org> <877fv553ss.fsf@taylan.uni.cx> <87y4nkwdxm.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]:47901) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSq0P-0005Ld-7Z for guix-devel@gnu.org; Tue, 03 Mar 2015 11:49:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YSq0O-0008EU-4T for guix-devel@gnu.org; Tue, 03 Mar 2015 11:49:13 -0500 In-Reply-To: <87y4nkwdxm.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Thu, 26 Feb 2015 22:39:01 +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: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org 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. 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.) 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... Taylan