We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
there are two main ways of declaring a variable type:
var
var 0@: int
var $var: int
int a
int 0@
int $var
For local variables (@) and global variables ($, &) the end result is the same regardless of the chosen syntax.
For identifiers the results are different.
int a acts similarly to const a = 0@ var a: int yields no error, but does not create a new variable either. var a: int = 100 produces an error
const a = 0@
var a: int
var a: int = 100
declaring another constant with the same name shadows the variable declaration:
const a = $100 int a a = 1 // expected local var 0@, got $100
const a = $100 var a: int = 100 // compiles as $100 = 0
const a = $100 int a = 0
should throw a duplicate constant name error 2. var a: int should mirror int a behavior
The text was updated successfully, but these errors were encountered:
is now a compile error (0090) in 4.0.0 beta.0
Sorry, something went wrong.
declares a new local variable (only in a CLEO script) in 4.0.0 beta.2
released in 4.0.0
No branches or pull requests
there are two main ways of declaring a variable type:
var
keyword.var 0@: int
,var $var: int
int a
,int 0@
,int $var
For local variables (@) and global variables ($, &) the end result is the same regardless of the chosen syntax.
For identifiers the results are different.
int a
acts similarly toconst a = 0@
var a: int
yields no error, but does not create a new variable either.var a: int = 100
produces an errordeclaring another constant with the same name shadows the variable declaration:
Expectation
should throw a duplicate constant name error
2.
var a: int
should mirrorint a
behaviorThe text was updated successfully, but these errors were encountered: