all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Tobias Geerinckx-Rice <me@tobias.gr>
Cc: guix-devel@gnu.org
Subject: Re: 04/04: offload: Avoid using '_' as a 'match' pattern.
Date: Fri, 21 Apr 2017 19:24:42 +0200	[thread overview]
Message-ID: <87pog5brmt.fsf@gnu.org> (raw)
In-Reply-To: <f85f2324-b672-905c-96b1-a97798220212@tobias.gr> (Tobias Geerinckx-Rice's message of "Fri, 21 Apr 2017 18:16:02 +0200")

Hi,

Tobias Geerinckx-Rice <me@tobias.gr> skribis:

> On 21/04/17 17:24, Ludovic Court�s wrote:
>> commit ba97e454bfbc168098212b37881b50b4fe6e1eb2 Author: Ludovic
>> Courtès <ludovic.courtes@inria.fr> Date:   Fri Apr 21 17:18:54 2017
>> +0200
>> 
>> offload: Avoid using '_' as a 'match' pattern.
>> 
>> * guix/scripts/offload.scm (host-key->type+key, machine-load) 
>> (process-request, guix-offload): Do not use '_' as a 'match'
>> pattern.
>
> Is this something that should now be avoided in general, i.e. when
> writing packages/..., or only in specific circumstances?

Only in modules that import (guix ui).

This is due to the fact that macros in Guile 2.2 match “literals”
differently: normal bindings (like ‘_’ from (guix ui)) can shadow
literals.  The ‘NEWS’ file of Guile 2.2 puts it this way:

  ** Fix literal matching for module-bound literals

  `syntax-rules' and `syntax-case' macros can take a set of "literals":
  bound or unbound keywords that the syntax matcher treats specially.
  Before, literals were always matched symbolically (by name).  Now they
  are matched by binding.  This allows literals to be reliably bound to
  values, renamed by imports or exports, et cetera.  See "Syntax-rules
  Macros" in the manual for more on literals.

In hindsight, it would have been wiser to just rename ‘_’ in (guix ui)
to something else, like ‘G_’.  Well, it’s not too late.  Should we do
that?  Thoughts?

Ludo’.

  reply	other threads:[~2017-04-21 17:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20170421152428.28671.46379@vcs0.savannah.gnu.org>
     [not found] ` <20170421152430.15A4A21037@vcs0.savannah.gnu.org>
2017-04-21 16:16   ` 04/04: offload: Avoid using '_' as a 'match' pattern Tobias Geerinckx-Rice
2017-04-21 17:24     ` Ludovic Courtès [this message]
2017-04-21 18:05       ` Mark H Weaver
2017-04-22 18:15         ` Alex Kost
2017-05-03 14:18         ` Ludovic Courtès
2017-04-22 18:46       ` Tobias Geerinckx-Rice

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

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

  git send-email \
    --in-reply-to=87pog5brmt.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=me@tobias.gr \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.