Closed
Description
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