-
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
Question about variable affectation #7
Comments
The
|
What Ryan (kirbyfan64) said is true. Here's another attempt at explanation. The name of the variable always comes first. The colon denotes the type of the variable, and the = denotes an assignment to a value. So, |
The current readme doesn't sell ':=' for me at all. It seems to map essentially 1:1 with the existing C++ approach.
...so what are the advantages? I like the explicit uninitialized value... but that could be a simple extension to the C++ approach. It seems to me that this is trying to mimic a more functional style... but that is weird for a language that's supposedly C-style. |
Hi,
As I new comer here is my first reaction to the syntax:
counter: int = 0;
Oki fair enough. It seems that a colon is used to define new variables... Oki I think I get it.
counter := 0;
Wait a minute, now the colon seems to be part of ":=" pair... What does this mean. It seem colon as a contextual meaning. Is counter: = 0; equivalent? This is confusing.
counter: int;
Yet another syntax to remember.
Do we really need a colon here? Is it to express a new variable declaration or assign a type explicitly? I think the use of it in this first example is confusing... Can't we just remove it entirely?
Just saying that having a confusing syntax as a first example is off putting.
The text was updated successfully, but these errors were encountered: