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

syntactic sugar for define/create with default args #2315

Open
Licenser opened this issue Apr 20, 2023 · 0 comments
Open

syntactic sugar for define/create with default args #2315

Licenser opened this issue Apr 20, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@Licenser
Copy link
Member

Licenser commented Apr 20, 2023

Describe the problem you are trying to solve

When defining an operator and wanting to access the config this needs to be exposed over args as the define statement, while really nice for defaulting this can lead to a lot of boilerplates.

  define operator batch from generic::batch args
    count,
    time
  with
    count = args.count,
    time = args.time
  end;
  create operator batch with count = 42, time = 23;

Describe the solution you'd like

We could remove the boilerplate by adding syntactic sugar that follows the rule:

If a define does not have a args or with the statement, it automatically gets it's args populated with the the available options in with.

Risks

Following risks exist:

  1. how to handle it when "not set" for a with element has a meaning, we need to think about it
  2. how do we reach for the defaults in with when creating the sugar-args
  3. does this impact exportability
@Licenser Licenser added the enhancement New feature or request label Apr 20, 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