unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Maxime Devos <maximedevos@telenet.be>
To: Attila Lendvai <attila@lendvai.name>, 54674@debbugs.gnu.org
Subject: [bug#54674] [PATCH] services: configuration: Use *unspecified* instead of 'disabled.
Date: Fri, 01 Apr 2022 21:56:58 +0200	[thread overview]
Message-ID: <0be3a60eb95672b6dc5101b966c85f2f3c810224.camel@telenet.be> (raw)
In-Reply-To: <20220401191957.16624-1-attila@lendvai.name>

[-- Attachment #1: Type: text/plain, Size: 976 bytes --]

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.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

  parent reply	other threads:[~2022-04-01 19:58 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-01 19:19 [bug#54674] [PATCH] services: configuration: Use *unspecified* instead of 'disabled Attila Lendvai
2022-04-01 19:46 ` Maxime Devos
2022-04-01 19:56 ` Maxime Devos [this message]
2022-04-01 19:58 ` Maxime Devos
2022-04-04  7:46   ` Attila Lendvai
2022-04-04 11:25     ` Maxime Devos
2022-04-18  9:26       ` Attila Lendvai
2022-04-07 13:52 ` [bug#54674] [PATCH v2 1/2] services: configuration: Support (field1 maybe-number "") format Attila Lendvai
2022-04-07 13:52   ` [bug#54674] [PATCH v2 2/2] services: configuration: Use *unspecified* instead of 'disabled Attila Lendvai
2022-04-07 15:01 ` [bug#54674] [PATCH v3 1/2] services: configuration: Support (field1 maybe-number "") format Attila Lendvai
2022-04-07 15:01   ` [bug#54674] [PATCH v3 2/2] services: configuration: Use *unspecified* instead of 'disabled Attila Lendvai
2022-04-20  9:15 ` [bug#54674] [PATCH v4 1/2] services: configuration: Support (field1 maybe-number "") format Attila Lendvai
2022-04-20  9:15   ` [bug#54674] [PATCH v4 2/2] services: configuration: Use *unspecified* instead of 'disabled Attila Lendvai
2022-04-23 14:55   ` [bug#54674] [PATCH v4 1/2] services: configuration: Support (field1 maybe-number "") format Maxime Devos
2022-05-17 11:38     ` Attila Lendvai
2022-05-17 16:15       ` Maxime Devos
2022-05-19 14:21         ` Attila Lendvai
2022-05-19 20:41           ` Attila Lendvai
2022-04-24 22:41 ` [bug#54674] [PATCH] doc: Follow the 'disabled -> *unspecified* configuration refactor Attila Lendvai
2022-05-17 11:39 ` [bug#54674] [PATCH v5 1/3] services: configuration: Support (field1 maybe-number "") format Attila Lendvai
2022-05-17 11:39   ` [bug#54674] [PATCH v5 2/3] services: configuration: Use *unspecified* instead of 'disabled Attila Lendvai
2022-05-17 11:39   ` [bug#54674] [PATCH v5 3/3] doc: Follow the 'disabled -> *unspecified* configuration refactor Attila Lendvai
2022-06-14 22:31     ` bug#54674: [PATCH] services: configuration: Use *unspecified* instead of 'disabled 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=0be3a60eb95672b6dc5101b966c85f2f3c810224.camel@telenet.be \
    --to=maximedevos@telenet.be \
    --cc=54674@debbugs.gnu.org \
    --cc=attila@lendvai.name \
    /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).