You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
where |- is a "given that" sign. The expression to the left of |- is evaluated after the expression on the right is unified. Then we can write things like
s |- (s<100 & pad10 & { out: s, in: n }) | s="too big"
This kind of layering of guards and conditionals is something we would do in a sequence of expressions in an imperative language. In Cue right now, it has to be moved somewhere else in the program instead of being kept local to the value.
#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:
with named parameter fields and an output field
Describe the solution you'd like
Per @mpvl, something like this could work:
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
The text was updated successfully, but these errors were encountered: