Skip to content
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

Consider maintaining/exposing set of all valid options for given record #3

Open
kyleam opened this issue Jun 2, 2023 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@kyleam
Copy link
Collaborator

kyleam commented Jun 2, 2023

In gh-1, the idea of maintaining the set of valid options for a record came up for two reasons:

  • doing so would enable get_record_option to error if an unknown option is passed
  • exposing it could be helpful for developers

The main complication is that *_option_names environment for records covers most of the options, but some are missing:

  • option_pos names (that includes option_nested, which is a subclass of option_pos)
  • the names in matrix_prefix_options
  • the option_record_name option (not very interesting)
kyleam referenced this issue Jun 2, 2023
An error is signaled when an option isn't found in a record.  When
callers require the option be set, this behavior allows them to avoid
doing the error handling.  On the other hand, callers checking whether
a non-essential option might be present need to catch the error if
they want to use get_record_option().

At this point, it's not clear which case will be more common, but
switch to the NULL values to make processing a bit more concise for
the "not required" case, as suggested by @seth127 and @barrettk.
@kyleam kyleam added the enhancement New feature or request label Jun 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant