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
Specification pretty explicitly says that default values must be unified independently:
The rewrite rules for unifying such values are as follows:
U0: ⟨v1⟩ & ⟨v2⟩ => ⟨v1&v2⟩
U1: ⟨v1, d1⟩ & ⟨v2⟩ => ⟨v1&v2, d1&v2⟩
U2: ⟨v1, d1⟩ & ⟨v2, d2⟩ => ⟨v1&v2, d1&d2⟩
Although following snippet behaves weirdly:
x: (2|*1) & (2|*2) // cue eval returns x: 2
The x: 2 is unexpected part as here we have <2 | 1, 1> & <2 | 2, 2> which should be unified as <2, _|_>.
Also, if expression will be changed a bit to the following one then evaluation result changes:
This is weird. Whats happened here? Looks like a bug or some refinement of the spec required...
UPD: sorry, this is very dumb question. Obviously <2, _|_> will be resolved to the concrete value without any defaults. I just were confused a bit and thought that 2 on the left side can produce concrete value.
$> cue version
cue version v0.8.0
go version go1.22.1
-buildmode exe
-compiler gc
DefaultGODEBUG httplaxcontentlength=1,httpmuxgo121=1,tls10server=1,tlsrsakex=1,tlsunsafeekm=1
CGO_ENABLED 1
GOARCH amd64
GOOS linux
GOAMD64 v1
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
-
Specification pretty explicitly says that default values must be unified independently:
Although following snippet behaves weirdly:
The
x: 2
is unexpected part as here we have<2 | 1, 1> & <2 | 2, 2>
which should be unified as<2, _|_>
.Also, if expression will be changed a bit to the following one then evaluation result changes:
This is weird. Whats happened here? Looks like a bug or some refinement of the spec required...
UPD: sorry, this is very dumb question. Obviously
<2, _|_>
will be resolved to the concrete value without any defaults. I just were confused a bit and thought that2
on the left side can produce concrete value.Beta Was this translation helpful? Give feedback.
All reactions