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

Should Call support functions without arguments? #9

Closed
pimvenderbosch opened this issue Nov 4, 2024 · 1 comment
Closed

Should Call support functions without arguments? #9

pimvenderbosch opened this issue Nov 4, 2024 · 1 comment

Comments

@pimvenderbosch
Copy link
Member

Follows up on the discussion in #7.
For the Call object a decision should be made if functions are supported without arguments.
Does the following code make sense:

instuctions = [
    Assign("%N", Call("some_func"))
    ⠇
]

Related to this: are functions with void returns allowed. This could be supported by adding Call objects as possibility in Model.instructions: list[QuInstruct | Assign | Call].

@pimvenderbosch
Copy link
Member Author

After a discussion with @kaosmicadei, we concluded that there possibly are use cases for function calls without passing any arguments. Use cases include, but not limited to:

  • Random number generation
  • Using default values
  • Get some information from elsewhere

In our opinion, void returns shouldn't be allowed. If a function doesn't need to return something, the result can be ignored.

#7 already implements the behavior described above, so this issue will be closed.

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