unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Ricardo Wurmus <rekado@elephly.net>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 41140-done@debbugs.gnu.org
Subject: bug#41140: “guix system” suggests wrong module import when using “remove”
Date: Mon, 12 Apr 2021 18:21:08 +0200	[thread overview]
Message-ID: <87im4rv5hn.fsf@elephly.net> (raw)
In-Reply-To: <87lflyfchf.fsf@gnu.org>


Ludovic Courtès <ludo@gnu.org> writes:

> Hi,
>
> Ricardo Wurmus <rekado@elephly.net> skribis:
>
>>>From 40c1208cbe9cbfa58ee385ef6ee06b775d309753 Mon Sep 17 00:00:00 2001
>> From: Ricardo Wurmus <rekado@elephly.net>
>> Date: Sun, 10 May 2020 23:29:38 +0200
>> Subject: [PATCH] services: Support DELETE in MODIFY-SERVICES macro.
>>
>> * gnu/services.scm (%modify-service): Add clause for DELETE syntax.
>> (modify-services): Use FILTER-MAP; adjust docstring.
>> * doc/guix.texi (System Services): Mention alternative syntax.
>> (X Window): Use MODIFY-SERVICES syntax.
>
> I like it!
>
>> -  #:use-module (srfi srfi-1)
>> +  #:use-module ((srfi srfi-1) #:hide (delete))
>>    #:use-module (srfi srfi-9)
>>    #:use-module (srfi srfi-9 gnu)
>>    #:use-module (srfi srfi-26)
>> @@ -272,7 +273,11 @@ singleton service type NAME, of which the returned service is an instance."
>>      (service type value)))
>>  
>>  (define-syntax %modify-service
>> -  (syntax-rules (=>)
>> +  (syntax-rules (=> delete)
>> +    ((_ svc (delete kind) clauses ...)
>> +     (if (eq? (service-kind svc) kind)
>> +         #f
>> +         (%modify-service svc clauses ...)))
>
> Best practice suggests that ‘delete’ should be bound (info "(guile)
> Syntax Rules"):
>
> --8<---------------cut here---------------start------------->8---
>    Although literals can be unbound, usually they are bound to allow
> them to be imported, exported, and renamed.  *Note Modules::, for more
> information on imports and exports.  In Guile there are a few standard
> auxiliary syntax definitions, as specified by R6RS and R7RS:
> --8<---------------cut here---------------end--------------->8---
>
> Now, if we export a new ‘delete’ binding from here, it’ll annoy
> everyone.  So perhaps we can keep the srfi-1 ‘delete’ and re-export it,
> as done in (guix build utils)… though that situation is also annoying
> because we get warnings saying that it collides with core ‘delete’.
>
> Dunno, give it a try!

I finally did give it a try.  I’m re-exporting “delete” and I don’t get
any warnings.

I pushed this with commit a247f5c7537df7e0c09051ba22d5c95eb08f48b9.
Thank you for the review and your comments!

-- 
Ricardo




  reply	other threads:[~2021-04-12 16:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-08 22:00 bug#41140: “guix system” suggests wrong module import when using “remove” Ricardo Wurmus
2020-05-09  7:30 ` Danny Milosavljevic
2020-05-10 21:33 ` Ricardo Wurmus
2020-05-11 20:22   ` Ludovic Courtès
2021-04-12 16:21     ` Ricardo Wurmus [this message]
2020-05-11 20:23 ` 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=87im4rv5hn.fsf@elephly.net \
    --to=rekado@elephly.net \
    --cc=41140-done@debbugs.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).