-
Notifications
You must be signed in to change notification settings - Fork 20
Support for var and strict. #42
Comments
First and foremost. No matter what new feature or changes brought to the lang it will always be backward compatible and all previous structure and syntax will remain. Use strictThe implementation of the finalCounter = 0
value = 2
for i = 0 to 10 {
count = i * value
finalCountre = finalCounter + count
}
@finalCounter the expected output is
but this is what will be outputed
There are other pitfall in weak type, The introduction of the var
use strict
var one = 1
int32 two = new int32(2)
It simple the variable one = 1
two = new int32(2) but if the use strict
...
one = "One as String" // since it initialized with `var`
two = "as two?" //throws an error as "as two" is a string and the variable is of the int32 data type So the above program that output use strict
var finalCounter = 0
var value = 2
for i = 0 to 10 {
count = i * value
finalCountre = finalCounter + count
}
@finalCounter we get this in our std err
All will be well documented in future. |
From your explanation, all I can summarise is this : The |
Not at all. The use strict
var one = 1 // correct we initialize 'one'
one = 4 // correct since one has been initialized with 'var' above
one = "a string" // correct var does not lock datatype it just for initializing
two = 3 //throws error 'two has not been initialized' Therefore using the |
Okay I understand now. The use of |
Yes |
Well then, I'll close the issue. So when will this implemented ? |
Anytime not so soon |
Okay then. I'll sure look out on this. |
Let leave it open till it done |
Simple is still new and the issue of backwards compatibility shouldn't be a major concern at this point. And a |
I think @appcypher has a point. Not everyone find the bugs easily perhaps having a syntax change is okay since we have the |
making |
From the ROADMAP, I saw this :
add and use the keyword
var
to allow variable declarationWhat's this all about ? .
Do you mean to declare variables in simple-lang after this is accomplished, it'll be:
instead of the current version of variable declaration ?
Also,
The support for
strict
is really nice but what are the plans for this ? Are we moving to a strictly typed syntax following the introduction of #38 ? . What improvements will the strictness bring especially to error handling ?The text was updated successfully, but these errors were encountered: