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

Support for array access #325

Open
niknetniko opened this issue Mar 21, 2023 · 1 comment
Open

Support for array access #325

niknetniko opened this issue Mar 21, 2023 · 1 comment
Labels
dsl enhancement New feature or request

Comments

@niknetniko
Copy link
Member

niknetniko commented Mar 21, 2023

We should add a new special kind of function as an allowed expression, being using (numeric) indices to access elements of an array or list.

Since we want to support this on the generic TESTed type sequence, we must consider the following cases:

  • How would we track the type of the array/list? For example, in Java, depending if the sequence is an array or a list, the syntax is different. Since we don't track the types of variables, we could work with helper functions, that use the correct notation at runtime.
  • The Python syntax (e.g. this_is_a_list[0]) can be used in the DSL. However, how would we differentiate array element access and dictionaries with numeric keys? See Support value access for dictionaries/maps #324.
@niknetniko niknetniko added enhancement New feature or request dsl labels Mar 21, 2023
@niknetniko
Copy link
Member Author

Another thing to consider is whether array access or dictionary access will be used most. One of them can be with the [] syntax, while the other will have to be with a function. We probably want to use the [] syntax for the most used one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dsl enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant