The following tsg stanza, while executed on an empty python file:
(module) {
var a = #true
if a {
print "a is true"
}
}
Will error:
Expected local value at (6, 8)
test.tsg:6:8:
6 | if a {
| ^
Where it would work just fine with an immutable "let":
(module) {
let a = #true
if a {
print "a is true"
}
}
Will print "a is true" as expected.
This is a weird behavior, as a should have the same scope in both cases. It also prevents to do patterns such as:
var a = ; some expression that might be null
if (is-null a) {
set a = ; some default value
}
Additionally I think that it is quite limiting not being able to execute conditionals on non-local values, why is that ?
The following tsg stanza, while executed on an empty python file:
Will error:
Where it would work just fine with an immutable "let":
Will print "a is true" as expected.
This is a weird behavior, as a should have the same scope in both cases. It also prevents to do patterns such as:
Additionally I think that it is quite limiting not being able to execute conditionals on non-local values, why is that ?