You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we want to do the same when this is passed into a User Op, it's easy enough if we always know the precise field path and can express it in dotted notation or with indexing.
However, we expect users will want to write User Ops when the field name/path is not known in advance and it's passed in from the main scope as a parameter. This currently works fine with a top-level field reference.
With the changes in the linked PR #4663, I can now pass in a dotted reference to a nested field or use field referencing with indexing to retrieve a field's value from inside the user op. Updating the repro steps to align with the revised syntax, we now see:
Repro is with Zed commit 2314053.
Let's start from this very simple example of outputting the value from a field in an embedded record.
If we want to do the same when
this
is passed into a User Op, it's easy enough if we always know the precise field path and can express it in dotted notation or with indexing.However, we expect users will want to write User Ops when the field name/path is not known in advance and it's passed in from the main scope as a parameter. This currently works fine with a top-level field reference.
However, there's not currently a way to reference a nested field path this way. For instance, if I was a user hacking away, I might attempt:
We've discussed as a team implementing an approach to this using "first class paths".
The text was updated successfully, but these errors were encountered: