Skip to content

Add .loadFromSlice() #2978

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

Open
skywardboundd opened this issue Apr 29, 2025 · 0 comments · May be fixed by #3012
Open

Add .loadFromSlice() #2978

skywardboundd opened this issue Apr 29, 2025 · 0 comments · May be fixed by #3012
Labels
kind: language feature Intent to add a language feature
Milestone

Comments

@skywardboundd
Copy link
Contributor

skywardboundd commented Apr 29, 2025

This function is intended to perform operations similar to the following:

Item.loadFromSlice(payload)
/*
item'var1 = payload~load_uint(1);
...
item'var10 = payload~load_uint(10);  
*/

Currently, .fromSlice reads from the slice but does not modify it. This is useful when you need to read structures in a loop or when two structures are stored in the same slice.

It may help here:

let outActions = actions.loadMaybeRef();

@skywardboundd skywardboundd added the kind: language feature Intent to add a language feature label Apr 29, 2025
@skywardboundd skywardboundd linked a pull request May 6, 2025 that will close this issue
4 tasks
@skywardboundd skywardboundd linked a pull request May 6, 2025 that will close this issue
4 tasks
@skywardboundd skywardboundd added this to the v1.7.0 milestone May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: language feature Intent to add a language feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant