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

Planned extension: named arguments #29

Open
alastairreid opened this issue Feb 10, 2025 · 0 comments
Open

Planned extension: named arguments #29

alastairreid opened this issue Feb 10, 2025 · 0 comments

Comments

@alastairreid
Copy link

For functions with a large number of arguments or where there is no obvious logical order to the arguments or where consecutive arguments are booleans, a function call like "ReadMemory(address, size, TRUE, TRUE, FALSE)" is quite meaningless.

To fix this, we plan to extend ASL with support for named arguments so that you can write things like

ReadMemory(address, size, aligned=TRUE, virtual=TRUE, stack_access=FALSE)

Details:

  • Strict matching: The argument name in positition "i" in the call must match the argument name in position "i" in the definition. This is intended to make code more readable and less error prone, not to make the code easier to write.
  • Instead of using "arg=value", we could use "arg:value". The first runs the risk of confusion with "arg==value", while the latter looks a bit like a type declaration.
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

No branches or pull requests

1 participant