-
Notifications
You must be signed in to change notification settings - Fork 294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Easier conditional groups in list comprehension #798
Comments
Original reply by @myitcv in cuelang/cue#798 (comment) This will be addressed by the query proposal in #165:
|
Original reply by @verdverm in cuelang/cue#798 (comment) Is there anything that hard prevents the suggested syntax above? (@mpvl) The benefit I see with it is:
|
Original reply by @myitcv in cuelang/cue#798 (comment)
It's (currently) illegal because it's neither a valid embedded scalar, nor it is a valid struct value.
Like this?
It's true there is a close relationship between the two, but I'm not sure we'd want to introduce a "third" way of writing things. Re-opening for @mpvl's answer in any case. |
Original reply by @verdverm in cuelang/cue#798 (comment) For some extra context, this started from a discussion on Slack, where one of the examples is the following
|
Original reply by @mpvl in cuelang/cue#798 (comment) @verdverm: the suggested syntax would contradict what that syntax typically means. It already means something in one context and it would be very unsurprising to have it mean something else in another. There are probably also cases where the original syntax has meaning in this context. |
Originally opened by @verdverm in cuelang/cue#798
Is your feature request related to a problem? Please describe.
I have a list which has elements that are conditionally included. Some of them are groups and always appear together. The way to write this most intuitively is an error.
Describe the solution you'd like
Describe alternatives you've considered
[for x in aa if a == "on" { x } ]
The text was updated successfully, but these errors were encountered: