-
Notifications
You must be signed in to change notification settings - Fork 153
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
[KIP] - Record update syntax for modifying a single element of a record #1295
Comments
Hmm, I think something even more general would be necessary because we need to do this in a function rule. But I'm not sure what is supposed to happen in the In our problematic case, we need to do this in a function rule, so to replicate the above example we would need to do a "nested rewrite" and capture the name. So in our case, it would look like this:
Maybe it would be easier to just add syntax for updating records, similar to what exists for Maps?
|
Yes, the above Your example won't work I don't think because the |
Ah, now I get why the
I like that. |
With supported
|
Closing as a duplicate of #2477 |
@hjorthjort found a use-case where being able to update a single entry in a record-type would make the semantics much cleaner runtimeverification/wasm-semantics#333 (comment).
We have to use a work-around for now, but it would be nice if we could do something like:
In this example,
transformData
needs to get the updated record, but we don't want to have to mention all the fields ofR
to build the updated record and pass it into the function (becauserecord
could have many fields).The text was updated successfully, but these errors were encountered: