GNU bug report logs -
#56799
(gnu services configuration) usage of *unspecified* is problematic
Previous Next
Full log
Message #71 received at 56799 <at> debbugs.gnu.org (full text, mbox):
Hi Ludo,
Ludovic Courtès <ludo <at> gnu.org> writes:
> Hi!
>
> Maxim Cournoyer <maxim.cournoyer <at> gmail.com> skribis:
>
>> Since commit 8cb1a49a3998c39f315a4199b7d4a121a6d66449, the
>> define-configuration machinery in (gnu services configuration) uses
>> *unspecified* instead of 'disabled for an unspecified field value.
>
> As Attila wrote, the rationale as discussed in
> <https://issues.guix.gnu.org/54674> was to specifically use a “special”
> value without a read syntax in lieu of a symbol like 'disabled.
>
>> While this is indeed an improvement in readability, it introduces an
>> extra complication: because this new value is not self-quoting, it
>> cannot be used as is in G-Exps, and values using it must be carefully
>> expanded outside the gexp context, which is error prone.
>
> Could you give a simple example of how this can happen?
>
> In my experience, one would use ‘define-maybe’ and appropriate field
> serializers such that *unspecified* never goes through. Previously
> you’d check for (eq? x 'disabled) and now you just check for
> (unspecified? x).
Yes, I understand that. What changed is that previously you could have
the configuration serialized and used on the service side, which is what
using *unspecified* made impossible.
Granted, few services outside of Jami probably made use of this, but it
was nevertheless a useful property.
Thanks,
Maxim
This bug report was last modified 2 years and 326 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.