Open cueckoo opened 3 years ago
Original reply by @mpvl in https://github.com/cuelang/cue/issues/772#issuecomment-779762917
Yes, slices were once supported, but were removed from the language spec as their semantics was complicated and not desirable. At some point during the query design we realized there is a reasonable chance they will be added back. So rather than letting people go to the migration off of slices, we decided to hold off on that. But that means slices are somewhat in limbo as of now.
There is a good chance the will be back in some form. However, CUE allows for some interesting alternatives that may end up being considerably more readable than approaches from other languages, so no guarantee yet.
Either way, whatever we decide, there will be a transition where slices are automatically converted to another syntax if we decide to move to something else. For now it probably makes sense to support it in syntax highlighting.
Brief update on slices:
We are still quite undecided about this one.
x[y]
(including indexing) as it currently exists altogether.So the idea is to keep slices around as they are for now, but knowing that the semantics and syntax will very likely change. We will not remove it until support for a good alternative is available.
Originally opened by @jansorg in https://github.com/cuelang/cue/issues/772
What did you expect to see?
The definition of "Slice" at https://cuelang.org/docs/references/spec/#primary-expressions
What did you see instead?
The other references elements (
Selector
,Index
,Arguments
) are defined, but the definition ofSlices
isn't included in the language specifiction.