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

Provide a way to pass metadata to functions and between expressions #846

Open
davidalk opened this issue Sep 24, 2024 · 0 comments
Open
Labels
enhancement New feature or request subject: code generation This issue is about code generation subject: syntax This issue is about the syntax of Rosetta

Comments

@davidalk
Copy link
Contributor

If you consider the following function:

func MyFunc:
    inputs:
        myInput string (1..1)
        [metadata reference]
    output:
        myResult string (1..1)

    set myResult: myInput -> reference

In the above example the scheme of the input is not preserved on the way into the function so this will result in an error in the generated code.

Additionally the following example:

func MyFunc2:
    inputs:
        myInput string (1..*)
        [metadata reference]
    output:
        myResult string (1..*)
    set myResult: myInput extract reference

In this example you currently get a syntax error as the metadata is lost prior to using the extract operator.

This issue proposes that we support the concept of passing metadata to function and between expression operators and in doing so support the above two examples.

An additional aspect of this change will be to support checking of the meta types when passing between functions and expressions. So if you consider the following:

func MyFunc3:
    inputs:
        myInput string (1..1)
    output:
        myResult string (1..1)
    set myResult: MyFunc(myInput)

This above set operation will now be invalid as MyFunc requires a string with a metadata reference but instead got just a string.

@SimonCockx SimonCockx added enhancement New feature or request subject: code generation This issue is about code generation subject: syntax This issue is about the syntax of Rosetta labels Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request subject: code generation This issue is about code generation subject: syntax This issue is about the syntax of Rosetta
Projects
None yet
Development

No branches or pull requests

2 participants