From: Xinglu Chen <public@yoctocell.xyz>
To: "Ludovic Courtès" <ludo@gnu.org>,
"Maxim Cournoyer" <maxim.cournoyer@gmail.com>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: Add a way to disable serialization support to (guix services configuration)
Date: Fri, 23 Apr 2021 08:09:55 +0200 [thread overview]
Message-ID: <871rb15y6k.fsf@yoctocell.xyz> (raw)
In-Reply-To: <87mttqt0ms.fsf@gnu.org>
Hi,
On Fri, Apr 23 2021, Ludovic Courtès wrote:
> Hi,
>
> Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:
>
>>> +(define-syntax-rule (without-field-serialization definition)
>>> + (syntax-parameterize ((configuration-field-serialization?
>>> + (identifier-syntax #f)))
>>> + definition
>>> + #t))
>>> +
>>> +(without-field-serialization
>>> + (define-configuration foo
>>> + (bar (integer 123) "doc")))
>
> In hindsight, I find this syntax quite inelegant and suboptimal.
>
> Wouldn’t it be nicer to write:
>
> (define-configuration foo
> (bar (integer 123) "doc" no-serializer)
> (baz (string "") "doc"))
>
> where ‘bar’ wouldn’t have a serializer and ‘baz’ would?
>
> It’s also probably easier to implement correctly.
I think that would be a good idea, maybe it could also make having a
default value be optional, like this:
#+begin_src scheme
(define-configuration foo
(bar (integer) "doc" no-serializer) ;no default
(baz (string "default") "doc"))
#+end_src
Maxim and I had a discussion about this[1].
[1]: https://yhetil.org/guix-devel/87k0ov7w72.fsf@yoctocell.xyz
next prev parent reply other threads:[~2021-04-23 6:10 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-12 20:57 Add a way to disable serialization support to (guix services configuration) Maxim Cournoyer
2021-04-17 16:29 ` Ludovic Courtès
2021-04-21 15:43 ` Maxim Cournoyer
2021-04-22 22:28 ` Ludovic Courtès
2021-04-23 6:09 ` Xinglu Chen [this message]
2021-05-01 11:54 ` Xinglu Chen
2021-05-07 5:42 ` Maxim Cournoyer
2021-05-07 14:03 ` Xinglu Chen
2021-05-08 5:08 ` Maxim Cournoyer
2021-04-21 17:14 ` Maxim Cournoyer
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=871rb15y6k.fsf@yoctocell.xyz \
--to=public@yoctocell.xyz \
--cc=guix-devel@gnu.org \
--cc=ludo@gnu.org \
--cc=maxim.cournoyer@gmail.com \
/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).