GNU bug report logs - #54674
[PATCH] services: configuration: Use *unspecified* instead of 'disabled.

Previous Next

Package: guix-patches;

Reported by: Attila Lendvai <attila <at> lendvai.name>

Date: Fri, 1 Apr 2022 19:29:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Maxime Devos <maximedevos <at> telenet.be>
To: Attila Lendvai <attila <at> lendvai.name>, 54674 <at> debbugs.gnu.org
Subject: [bug#54674] [PATCH] services: configuration: Use *unspecified* instead of 'disabled.
Date: Fri, 01 Apr 2022 21:56:58 +0200
[Message part 1 (text/plain, inline)]
Attila Lendvai schreef op vr 01-04-2022 om 21:19 [+0200]:
+    		       (if (unspecified? (syntax->datum def))
     			   #`(#,name #,getter)
     			   #`(#,name #,getter (default #,def))))

I'm not sure this does what you want it to do:

(define-syntax foo
  (lambda (s)
    (syntax-case s ()
      ((_ bar)
       (pk (syntax->datum #'bar) (unspecified? (syntax->datum #'bar)))))))
(foo *unspecified*)
;;; (*unspecified* #f)

The problem is that, from the macro systems POV, *unspecified* is just
a variable reference to the global *unspecified* --- *unspecified*
isn't magic to the reader, the reader just interprets it as a symbol.

Suggestion:

(define-syntax foo2
  (lambda (s)
    (syntax-case s ()
      ((_ bar)
       (pk (syntax->datum #'bar)
           (and (identifier? #'bar)
                (free-identifier=? #'*unspecified* #'bar)))))))
(foo2 *unspecified*)
;;; (*unspecified* #t)

Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 3 years and 35 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.