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
#box: {
V=value: int
sum: {
A=arg: [...#box]
if len(A) > 1 {
result: V + (A[0].sum & {arg: A[1:]}).result
}
if len(A) == 1 {
result: V + A[0].value
}
}
}
box1: [...#box] & [for a in [1,2,3,4] {value: a}]
sum1: (box1[0].sum & {arg: box1[1:]}).result
And I'm not exactly clear if that's the expected behavior.
Is that fine to evaluate something recursively as long as we keep referring to different sub-struct unification, or should a bug should be filed against structural cycle detection.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Originally opened by @proppy in cuelang/cue#510
Starting with https://cue-review.googlesource.com/c/cue/+/6522 the following is resulting rightfully in a structural cycle error:
But this doesn't:
And I'm not exactly clear if that's the expected behavior.
Is that fine to evaluate something recursively as long as we keep referring to different sub-struct unification, or should a bug should be filed against structural cycle detection.
Beta Was this translation helpful? Give feedback.
All reactions