dry-configurable
dry-configurable copied to clipboard
Leave setting values as `Undefined` rather than coercing to `nil` for un-set settings
This is something @solnic mentioned a while ago as a change he'd like to see for 1.0.0. Opening this so we can have the discussion as whether this is something we still want.
Related to this would be changing the expected signature for setting value processor blocks: they must be prepared for their value argument not to be provided for undefined values, so a processor block like this:
-> v {
# some logic
}
Must become:
-> v = "default" {
# some logic
}
When a setting is defined with a default, however, this can just be kept as -> v { }
, since the default value will always be passed.
This arrangement would encourage the authors of the setting definitions to make sure they're properly handling the case of a non-provided value in their processor blocks if no default is otherwise defined.
I'm in favor. This is definitely the place that can benefit from Undefined
. I wish we didn't have to break things but this is for the greater good :) Mb we could have prev behavior ... configurable (but not default).