-
Notifications
You must be signed in to change notification settings - Fork 302
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
Add a builtin to remove a field #139
Comments
Original reply by @mpvl in cuelang/cue#139 (comment) I can imagine something like |
Original reply by @rudolph9 in cuelang/cue#139 (comment) This touches on something I presented in @mpvl proposal cuelang/cue#165 (comment) The syntax is still conflicting with other things but in the spirit of what is described in the link you could write |
Original reply by @rudolph9 in cuelang/cue#139 (comment) @mpvl Still a little rough but you can do this with current functionality v0.0.14:
The impl touches on some of our previous threads surrounding comprehensions and structural cycles but I believe falls within what is described in the spec. |
Originally opened by @nlewo in cuelang/cue#139
To create a new structure by overriding an existing structure, it would be nice to be able to remove a field from this structure. This field could then be modified with unification.
For instance, let's consider the structure:
Now suppose I want to create a modified version
r
ofs
:With a removeField builtin
r
could be created like:Note this can be implemented with several nested field comprehensions, but it's really unreadable!
removeField
arguments?The text was updated successfully, but these errors were encountered: