Feature request: mechanism to put local variables in memory #3223
Labels
closed due inactivity
The issue/PR was automatically closed due to inactivity.
feature
language design
Any changes to the language, e.g. new features
stale
The issue/PR was marked as stale because it has been open for too long.
One aspect of the stack depth limit issue is described in #3222 (inability to remove local variables from the stack). Another aspect is that Solidity does not allow the user to specify whether a variable should be stored in memory or on the stack. However, it is often useful for the programmer to be able to specify where to put variables (primarily due to the stack depth limit).
I'm making this issue to, first, ask whether this was an intentional design decision -- if so, why? -- and second, to propose that a mechanism to put local variables in memory be added to Solidity.
For reference, in Serpent, the programmer could specify where local variables would be stored as follows:
In Solidity, the
memory
keyword might be a natural way to implement this. For example:The text was updated successfully, but these errors were encountered: