Open ghost opened 5 years ago
Currently there is no way to construct an array from stream carrying scalars. Having a feature like this (and a similar one for structs) would indeed help a lot, and is worth looking into.
I wouldn't know how to go about it. I'm thinking about kinds and arities, but I'm not sure we could make it work.
Update: Someone is working on a feature atm that would allow us to implement this.
Update: @InnovativeInventor has implemented 'set' or 'update' for arrays, which allows us to implement this. We'll be discussing integrating this into Copilot in the upcoming future.
Update: similar requests have come up recently related to structs. We are looking into porting the solution that @InnovativeInventor prepared to work for structs and adding both to Copilot. Stay tuned.
For awareness, we have an open issue #520 that we intend to merge today on updating fields of structs.
Description
Copilot currently supports reading values from streams of arrays, but not changing them.
We'd like to be able to modify an array by adjusting the value at a specific position.
Type
Additional context
None.
Requester
Method to check presence of bug
Not applicable (not a bug).
Expected result
Copilot provides a mechanism to update specific values in arrays in an stream of arrays.
Desired result
Copilot provides a mechanism to update specific values in arrays in an stream of arrays.
Proposed solution
Extend copilot-language
to provide operations to modify values of arrays in streams.
Extend copilot-core
, copilot-c99
and other libraries accordingly.
Further notes
None.
Change Manager: Confirmed that the issue exists.
Technical Lead: Confirmed that the issue should be addressed.
Technical Lead: Issue scheduled for Copilot 4.
Fix assigned to: @ivanperez-keera.
If I have 2 streams carrying doubles, such as:
Is it possible to define, with some function (or maybe an
Op2
):