Skip to content

modules: Add a module for DSL introspection #14585

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dcbaker
Copy link
Member

@dcbaker dcbaker commented May 9, 2025

This module provides methods for looking at the types of variables. The main thought for this is values returned from user data, such as meson.get_external_property(), and allowing choices to be made based on type information.

This implementation is rather incomplete, and there is no documentation provided (yet?).

Largely at this point I want to solicit feedback from the community, as I am concerned that this may help some niche cases, but be as a whole be a determent.

Cases that have come up where it would be helpful:

  1. meson.get_external_property(), where the type cannot be known

My hope is that we can either build consensus to move forward with this OR to build consensus to add language to the documentation as to why we don't have this, and don't want to add it, similar to the section on functions and macros.

This module provides methods for looking at the types of variables. The
main thought for this is values returned from user data, such as
`meson.get_external_property()`, and allowing choices to be made based
on type information.
@bruchar1
Copy link
Member

bruchar1 commented May 9, 2025

Is there other cases where the type is unknown? I fear that having such a module would be more confusing than helpful...

What I would rather propose would be to return a property object, with converter methods (to_array(), to_int(), to_string()) and, if needed, introspection methods (is_array(), is_string(), etc.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants