unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: taylanbayirli@gmail.com (Taylan Ulrich Bayırlı/Kammer)
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel@gnu.org
Subject: Re: Some macros to make package definitions prettier
Date: Tue, 03 Mar 2015 17:49:07 +0100	[thread overview]
Message-ID: <87wq2ydo1o.fsf@taylan.uni.cx> (raw)
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")

ludo@gnu.org (Ludovic Courtès) writes:

> I’ve 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

  reply	other threads:[~2015-03-03 16:49 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-25 16:42 Some macros to make package definitions prettier Taylan Ulrich Bayırlı/Kammer
2015-02-25 17:04 ` Thompson, David
2015-02-25 17:06   ` Thompson, David
2015-02-25 19:27     ` Taylan Ulrich Bayırlı/Kammer
2015-02-25 20:54   ` Taylan Ulrich Bayırlı/Kammer
2015-02-25 18:12 ` Andreas Enge
2015-02-25 19:46   ` Taylan Ulrich Bayırlı/Kammer
2015-02-25 20:24   ` Thompson, David
2015-02-25 23:32 ` Ludovic Courtès
2015-02-26 11:07   ` Taylan Ulrich Bayırlı/Kammer
2015-02-26 21:39     ` Ludovic Courtès
2015-03-03 16:49       ` Taylan Ulrich Bayırlı/Kammer [this message]
2015-03-03 20:44         ` Ludovic Courtès
2015-03-03 22:47           ` Taylan Ulrich Bayırlı/Kammer
2015-03-04  9:52             ` Ludovic Courtès
2015-02-26 21:41     ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wq2ydo1o.fsf@taylan.uni.cx \
    --to=taylanbayirli@gmail.com \
    --cc=guix-devel@gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).