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

"invoke" for functions #462

Open
mattheww opened this issue Nov 4, 2023 · 0 comments
Open

"invoke" for functions #462

mattheww opened this issue Nov 4, 2023 · 0 comments

Comments

@mattheww
Copy link
Contributor

mattheww commented Nov 4, 2023

The spec relies on the notion of "invoking" a function in several places, but the process is never defined.

For example §6.12.1:9 (fls_yrr1s0tucgvh) says:

If the callee type is a function item type or a function pointer type, then the value is the result of invoking the corresponding function with the argument operands.

Compare §6.19:7 (fls_bqmwlona6l5w) for return expression, which is written in terms of activation frames and transfer of control.

Something needs to say that a pattern match happens between the argument operands and the patterns represented by the function's FunctionParameterPatterns, effectively resulting in additional local variables.

Compare this text from the Rust Reference:

The block of a function is conceptually wrapped in a block that binds the argument patterns and then returns the value of the function's block.

This needs to tie up with §14.4.1:3 "The binding of a function parameter is in scope within the related function body", and with §15.5 "Passing Conventions".

A different definition would be needed for external functions (and that one has to deal with variadics).

@Veykril Veykril assigned Veykril and unassigned Veykril Nov 15, 2023
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

2 participants