-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
How to splat dict
objects into function kwargs?
#14276
Comments
A = dependency('A', kwargs: common)
C = dependency('C', kwargs: common, fallback: ['C', 'c_dep']) |
Well would you look at that; since 0.49.0 it seems. It could stand to be made more visible on the main website, but that pretty much closes out this issue |
Yeah, the docs are a bit hidden away at https://mesonbuild.com/Syntax.html#function-calls On the other hand it's not immediately obvious where else to put this as it's not specific to any given function, just part of the interpreter semantics... |
My usual go-to is the Reference Manual; as soon as you mentioned |
Dunno. Calling out "kwargs" specifically is something I'm not sure how to word well. Although maybe we should link to the Syntax page from there either way? At any rate, documentation PRs are most certainly welcome. :) |
dict
objectsdict
objects into function kwargs?
This change proposes an update to the grammar of meson to introduce a splat operator,
**d
, fordict
types.The syntax and semantics of this operator would be equivalent to Python's splat operator.
The rationale for introducing this operator would be to provide an alternative to the following pattern:
...which with a new splat operator, could be more clearly expressed as :
This pattern helps to circumvent some sharp edges with existing systems.
For example, suppose our dependencies A, B, C are all subprojects, with A and B being defined by .wrap files.
Also suppose that for C, I need to set the
fallback:
property.Setting the
fallback:
property to anything disables .wrap file lookup, meaning I cannot express my intent cleanly or concisely using the first pattern, but would be able to with the proposed feature.The text was updated successfully, but these errors were encountered: