guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#63985] [PATCH RFC 0/5] Generic INI serializer & SRFI-171 for define


From: Maxim Cournoyer
Subject: [bug#63985] [PATCH RFC 0/5] Generic INI serializer & SRFI-171 for define-configuration
Date: Mon, 02 Oct 2023 14:28:08 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

Hi,

Bruno Victal <mirai@makinata.eu> writes:

> Rewrite this section to make it easier to document later syntactical
> changes.
>
> * doc/guix.texi (Complex Configurations): Rewrite define-configuration
> documentation. Fix simple serializer example.

[...]

> +@item @code{(serializer @var{serializer})}
> +@var{serializer} is the name of a procedure which takes two arguments,
> +the first is the name of the field, and the second is the value
> +corresponding to the field.  The procedure should return a string or
> +@ref{G-Expressions} that represents the content that will be serialized
> +to the configuration file.  If none is specified, a procedure of the
> +name @code{serialize-@var{type}} will be used.
> +
> +An example of a simple serializer procedure:
> +@lisp
> +(define (serialize-boolean field-name value)
> +  (let ((value (if value "true" "false")))
> +    #~(string-append '#$field-name #$value)))
> +@end lisp
> +

I know this is adapted from old code, but shouldn't there be a "=" in
that string-append, between the field name and its value?  Also, using
gexps here seems unnecessary and may confuse the reader.

The rest LGTM!

-- 
Thanks,
Maxim





reply via email to

[Prev in Thread] Current Thread [Next in Thread]