-
-
Notifications
You must be signed in to change notification settings - Fork 310
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
Add a routine to remove entries from a construction variable #4332
Comments
Expanding a bit on the questions...
|
After letting this stew for a bit... the last bullet is not needed, you can just
:: Remove values from construction variables. For each |
The current SCons API has ways to add to construction variables with
Append
,AppendUnique
,Prepend
,PrependUnique
,AppendENVPath
,PrependENVPath
and to directly assign to -Environment
kwargs, ovverrides in builder calls,Replace
. What is does not seem to include is a way to remove elements from a multi-element construction var. Resorting to pure Python syntax is not completely desirable, because then you have to know the type holding the construction variable to pick the right syntax. This has become a little more prominent now since 4.5 forCPPDEFINES
, which, if it gets converted internally, will end up as a deque - a type people probably won't guess (we might still want to change that back to a plain list type) - but it's not actually a new problem, because the appending logic has always been able to do type conversions of its own choosing.An initial thought is the syntax could look somewhat like a dictionary's
pop
method:The "return the corresponding value" part isn't that essential, but list-oriented methods typically need an index to remove a value, and it feels like it would be a nicer to do the lookup for the user.
CPPDEFINES
, which always needs special case handling as its members may be containers, not just scalars, already has a "match" routine -_is_in
, currently an inner function but which could be moved outside - and possibly be given an optional arg to remove the found entry.Open to better suggestions for design (and name) of the interface...
The text was updated successfully, but these errors were encountered: