3 ms·
"That code is broken; the observation that a field has its default value does not imply that no value was set" That doesn't necessarily mean the code is broken
by fauigerzigerk 13y ago
"That code is broken; the observation that a field has its default value does not imply that no value was set"
That doesn't necessarily mean the code is broken. It may or may not be possible in a particular situation to treat the zero value as semantically special as I have done. But if it's not, then you are of course right that this creates an additional problem.
Using a seperate function to initialize a Config is fine, but you would actually have to create a makeConfigForF function because the defaults are specific to f and not to Config. It's all messy. That's why I like keyword default arguments.