GNU bug report logs -
#56799
(gnu services configuration) usage of *unspecified* is problematic
Previous Next
Full log
View this message in rfc822 format
Hi Attila,
Attila Lendvai <attila <at> lendvai.name> 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
This bug report was last modified 2 years and 327 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.