Skip to content
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

Array slices for memory and storage arrays. #7423

Open
ekpyron opened this issue Sep 13, 2019 · 5 comments
Open

Array slices for memory and storage arrays. #7423

ekpyron opened this issue Sep 13, 2019 · 5 comments
Labels
language design :rage4: Any changes to the language, e.g. new features must have eventually Something we consider essential but not enough to prevent us from releasing Solidity 1.0 without it.

Comments

@ekpyron
Copy link
Member

ekpyron commented Sep 13, 2019

In 0.6.0 we implemented array slices for dynamic calldata arrays.
We should also support them at least for dynamic memory arrays and maybe even for dynamic storage arrays. This will require more involved changes, though, since while calldata array slices and dynamic calldata arrays have the exact same stack layout and type conversion is a no-op, this won't be the case for memory and storage.
We could also think about the case of static arrays combined with slicing.

@ekpyron ekpyron changed the title Array slices for memoyr and storage arrays. Array slices for memory and storage arrays. Sep 13, 2019
@cameel cameel added feature language design :rage4: Any changes to the language, e.g. new features labels Aug 28, 2021
@0xad1onchain
Copy link

Are there any updates on this issue?

@github-actions
Copy link

This issue has been marked as stale due to inactivity for the last 90 days.
It will be automatically closed in 7 days.

@github-actions github-actions bot added the stale The issue/PR was marked as stale because it has been open for too long. label Feb 25, 2023
@github-actions
Copy link

github-actions bot commented Mar 5, 2023

Hi everyone! This issue has been automatically closed due to inactivity.
If you think this issue is still relevant in the latest Solidity version and you have something to contribute, feel free to reopen.
However, unless the issue is a concrete proposal that can be implemented, we recommend starting a language discussion on the forum instead.

@github-actions github-actions bot added the closed due inactivity The issue/PR was automatically closed due to inactivity. label Mar 5, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 5, 2023
@k06a
Copy link

k06a commented Oct 23, 2023

Would be cool to have it for storage, can do with Solidity libs nowadays

@ekpyron ekpyron added must have eventually Something we consider essential but not enough to prevent us from releasing Solidity 1.0 without it. and removed closed due inactivity The issue/PR was automatically closed due to inactivity. stale The issue/PR was marked as stale because it has been open for too long. labels Oct 24, 2023
@ekpyron ekpyron reopened this Oct 24, 2023
@k06a
Copy link

k06a commented Oct 25, 2023

What would you say about having new array access modifiers?

  • storage slice
  • memory slice

Which would have 2 variables on stack, similar to calldata offset and length?

Where storage and memory could have auto-cast to sliced versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language design :rage4: Any changes to the language, e.g. new features must have eventually Something we consider essential but not enough to prevent us from releasing Solidity 1.0 without it.
Projects
None yet
Development

No branches or pull requests

5 participants