-
Originally opened by @extemporalgenome in cuelang/cue#687 In the CUE language spec in the Aliases section (https://cuelang.org/docs/references/spec/#aliases) is the following syntactic form:
What is the purpose/meaning of the Is it just a throwaway expression to syntactically distinguish normal fields from aliases when used in this way? How would this be different from How are aliases and Thanks
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Original reply by @mpvl in cuelang/cue#687 (comment) The purpose of the A
would evaluate to
using a let
evaluates to
instead. In general if you see a A
|
Beta Was this translation helpful? Give feedback.
Original reply by @mpvl in cuelang/cue#687 (comment)
The purpose of the
X
inX="not an identifier": 4
is that it allows referencing the field. The field has a name that is not a valid identifier, so there would otherwise be no way to directly reference the field. For instance, thefoo: X
references that field and will evaluate tofoo: "not an identifier": 4
.A
let
introduces a name for an expression that can be reused without it being part of the output.So, where:
would evaluate to
using a let
evaluates to
instead.
In general if you see a
X =
it introduces a new name for the element it precedes, without otherwise changing the meaning of this…