Attila Lendvai <att...@lendvai.name> skribis:

>> There’s no widespread “Maybe” idiom in Scheme; or rather, people use
>> TYPE | #f as a way to approximate “Maybe”. It’s not ideal, primarily
>> because appropriate handling is not statically checked. Yet, that’s
>> what we have and I’m not convinced adding SRFI-189 to the mix would
>> bring enough of an improvement to justify it.
>>
>> Thoughts?
>
>
> configurations are full of boolean fields, where #f is a valid value.
>
> to represent unset fields, we would essentially need to implement half
> of srfi-189 (Maybe and Nothing), and in a potentially buggy way
> (e.g. using a symbol like 'disabled to represent an unset field value
> (i.e. the current solution) clashes with a field type of symbol?).

How about using ‘*unspecified*’ in those cases?

Out of curiosity, in what case do you need to represent “unset fields”?
I think in most or all of the existing configs, fields always have a
default value, there’s no “unset” state.

Thanks,
Ludo’.

Reply via email to