-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No way to set a configuration option to an empty value #33
Comments
If specifying an empty value currently does not work, then there is no other way. We should certainly make this possible, the question is how? While resetting an option to the default value if an empty value is given is unintuitive, it has been the behavior of the configuration system for a long time, so people might (even without noticing it) rely on it. If we change the behavior now, this would mean that we suddenly silently produce different values. |
What about a special option that will clear the option names it gets in its value list:
That would probably already be possible to implement without touching the common lib. But of course it is not obvious and adds more complexity to the already complex config option handling. The advantage would be that we do not need to extend the syntax/introduce special character sequences etc. |
No, this really needs to be done in this lib, but of course, there is also no problem with that and it would be much better than doing it somewhere else anyway. A reason why this needs to be done here is |
I guess I did not think this trough. Yeah makes total sense, so it cannot be decided by the tool and has to be done in common lib.
So just to get this right, does that mean you would be in favor of adding such an option here in |
No, I am not really in favor of adding such an option, I think it would be quite hard to discover and awkward to use. For example, there are still complications with includes. In order to avoid the above problem, we would have to apply this option immediately after parsing an included file. However, this would mean that this option could not be overridden in including files, which would make it behave differently from all other options. We would also have to think through what happens if this option is not specified in a config file but via some other way (in case of CPAchecker for example with And then for example in CPAchecker there are use cases where configuration instances are converted into strings, passed to some other component either in form of a config file or a list of command-line options, and then parsed again. I strongly suspect this would break here. |
One thing that came to my mind while thinking about this: We should probably not only provide a new way to set an option to the empty value, but also a new way to reset an option to the default value (i.e., what the current behavior of |
Taken from:
https://gitlab.com/sosy-lab/software/cpachecker/-/issues/578#note_412658216
The general problem is if an option that contains some kind of collection has a default value other than the empty list, how can we reset it to just contain the empty list?
The text was updated successfully, but these errors were encountered: