Subject: bug#56799: (gnu services configuration) usage of *unspecified* is problematic

From: Maxim Cournoyer <[email-masked]>
Date: Sat, 13 Aug 2022 22:57:05 -0400

Hi Attila,

Attila Lendvai <[email-masked]> writes:

[...]

>> prepare a patch for the other things mentionned here (an exported
>> symbol).

Thanks!

> i started implementing your suggestions, including the replacement of
> the scattered usage of (eq? 'unset ...) pattern. what i found is that
> the code is not very readable using MAYBE-VALUE-SET?, or at least not
> for me.
>
> first, it negates the boolean logic everywhere in the current code
> (i.e. larger diff, and/or the use of (if (not ...) a b)).
>
> and an example wrt readability:
>
> (if (maybe-value-set? field-default)
>     field-default
>     (configuration-missing-default-value ...)
>
> a value is never set, only places can be set to some value.

It's not clear to me why you think the above is less readable; in the
code I had to touch, the maybe-value-set? was more natural, as the cases
I dealt with often tested for (not (eq? 'unset ...)), so reversing the
logic allowed getting rid of the negation.  See
https://issues.guix.gnu.org/57168#13 for example.

>
> would you be fine if we renamed MAYBE-VALUE-SET? to UNSET-VALUE?

unset-value? sounds like an action; so I'd name it 'maybe-value-unset?';
but as I wrote above I don't really see the benefit/like the idea.

Thanks for working on it!

Maxim