Skip to content

Better syntax support for user-defined "functions" #1480

Closed
@myitcv

Description

@myitcv

#484 (reply in thread)

Is your feature request related to a problem? Please describe.

Per #484, user-defined "functions" are somewhat clumsy right now in that they have to be defined via something like:

#udf: {
  #foo: string
  out: "\(#foo)bar"
}

"quux": (#udf & {#foo: "foo"}).out

with named parameter fields and an output field

Describe the solution you'd like

Per @mpvl, something like this could work:

#udf: {
  #0: string
  
  "\(#0)bar"
}

"quux": #udf("foo")

which uses a combination of numbered definitions as parameter fields and an embedded scalar as the result.

Open question: how struct values would work in this case.

Describe alternatives you've considered

The workaround described above.

Additional context

n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions