-
Is there a convenient way of creating user-defined functions or something similar? Under boilerplate removal, the
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 9 replies
-
From @myitcv in Slack: this is the correct way to go for now, but the new evaluator will make this better by allowing non-structs to be emitted. Combined with type cast semantics (like those I proposed in #454), this will make these sorts of limited functions much easier to work with. |
Beta Was this translation helpful? Give feedback.
-
The current best answer is:
(a change from the previously marked answer because we now have full support for embedded scalars) There is a proposal to support a syntactic sugar based on this:
|
Beta Was this translation helpful? Give feedback.
-
Taking this idea a step further and adding a conditional:
The conditional version doesn't work with the embedding scalars approach. |
Beta Was this translation helpful? Give feedback.
-
This discussion has been migrated to cue-lang/cue#484. For more details about CUE's migration to a new home, please see cue-lang/cue#1078. |
Beta Was this translation helpful? Give feedback.
The current best answer is:
(a change from the previously marked answer because we now have full support for embedded scalars)
There is a proposal to support a syntactic sugar based on this: