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
Manual parsing of string-encoded paths is required, which is error prone. e.g. this does not handle spaces, definitions etc.
Describe the solution you'd like
Some CUE path-related builtins, e.g. a builtin equivalent of cue.ParsePath(). Indexing could be done via a builtin, or supported via [] if a cue.Path value is the index value.
Describe alternatives you've considered
Manual parsing and handling of paths via regular string indexing, as above. Which doesn't work in all cases because you cannot index a definition in this way at least.
Additional context
n/a
The text was updated successfully, but these errors were encountered:
Some consideration for such a piece of functionality:
currently AFAIK there is no way from CUE itself to programmatically construct a reference to a definition - that is, if there are no mentions of a particular definition name in the code, and in the absence of external references, we can know for sure that a definition with that name is unused. Allowing programmatic construction of a definition name alters this invariant - something to bear in mind at least.
some decision needed about internal (underscore-prefixed) names. Probably disallow them, as they have no universal meaning. Alternatively, could provide some way to mention the package in which such names are to be interpreted.
Is your feature request related to a problem? Please describe.
Consider:
Manual parsing of string-encoded paths is required, which is error prone. e.g. this does not handle spaces, definitions etc.
Describe the solution you'd like
Some CUE path-related builtins, e.g. a builtin equivalent of
cue.ParsePath()
. Indexing could be done via a builtin, or supported via[]
if acue.Path
value is the index value.Describe alternatives you've considered
Manual parsing and handling of paths via regular string indexing, as above. Which doesn't work in all cases because you cannot index a definition in this way at least.
Additional context
n/a
The text was updated successfully, but these errors were encountered: