-
Notifications
You must be signed in to change notification settings - Fork 81
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
Add support for "constant" keyword in tuples #13
Comments
Right now I don't really want to add type inference to the language, as I think the time could be better spent on other things. So I don't want to add a let keyword, but I'm open to reconsidering that in the future. I think adding a keyword for constant values could be useful though. |
Solidity uses the |
I just realised that we probably should add this modifier for tuple assignment as well. What do you think @nathanielCherian? |
For sure. I think we should wait until the modifier refactoring in #125 is merged, but it shouldn't be a tricky fix. |
so the
|
@mr-zwets I think variables assigned through tuple assignment can be reassigned. e.g. bytes x, bytes y = 0x1234.split(1);
x = 0x5678; |
ah right, I misremember the open issue on 'Can't redefine variables in tuples' #136 I'll just rename this current issue on the 'constant' keyword so it reflects the current state of things |
Currently defining a variable is
This can be non-obvious to developers who are used to keywords before declaring variables. Also in CashScript variables can be reassigned.
For that reason this ticket is to add support for
let
andconst
. Their functionality would be inline with other mainstream languages.let
would be for variables which can be reassigned.const
would be for variables which have a constant value.Both would be block scoped.
The text was updated successfully, but these errors were encountered: