This repository has been archived by the owner on Nov 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 171
Add a builtin to remove a field #139
Labels
FeatureRequest
New feature or request
NeedsDesign
Functionality seems desirable, but not sure how it should look like.
Comments
I can imagine something like |
mpvl
added
FeatureRequest
New feature or request
NeedsDesign
Functionality seems desirable, but not sure how it should look like.
labels
Oct 4, 2019
This touches on something I presented in @mpvl proposal #165 (comment) The syntax is still conflicting with other things but in the spirit of what is described in the link you could write |
@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. |
This issue has been migrated to cue-lang/cue#139. For more details about CUE's migration to a new home, please see cue-lang/cue#1078. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
FeatureRequest
New feature or request
NeedsDesign
Functionality seems desirable, but not sure how it should look like.
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: