From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: 04/04: offload: Avoid using '_' as a 'match' pattern. Date: Fri, 21 Apr 2017 19:24:42 +0200 Message-ID: <87pog5brmt.fsf@gnu.org> References: <20170421152428.28671.46379@vcs0.savannah.gnu.org> <20170421152430.15A4A21037@vcs0.savannah.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]:49866) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1cIc-00040I-Uh for guix-devel@gnu.org; Fri, 21 Apr 2017 13:24:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d1cIZ-0001vq-Rb for guix-devel@gnu.org; Fri, 21 Apr 2017 13:24:50 -0400 In-Reply-To: (Tobias Geerinckx-Rice's message of "Fri, 21 Apr 2017 18:16:02 +0200") 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" To: Tobias Geerinckx-Rice Cc: guix-devel@gnu.org Hi, Tobias Geerinckx-Rice skribis: > On 21/04/17 17:24, Ludovic Court=EF=BF=BDs wrote: >> commit ba97e454bfbc168098212b37881b50b4fe6e1eb2 Author: Ludovic >> Court=C3=A8s Date: Fri Apr 21 17:18:54 2017 >> +0200 >>=20 >> offload: Avoid using '_' as a 'match' pattern. >>=20 >> * guix/scripts/offload.scm (host-key->type+key, machine-load)=20 >> (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 =E2=80=9Cliterals=E2= =80=9D differently: normal bindings (like =E2=80=98_=E2=80=99 from (guix ui)) can = shadow literals. The =E2=80=98NEWS=E2=80=99 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 =E2=80=98_=E2=80=99 i= n (guix ui) to something else, like =E2=80=98G_=E2=80=99. Well, it=E2=80=99s not too l= ate. Should we do that? Thoughts? Ludo=E2=80=99.