Introduce the requirement of let for assignment.

This commit is contained in:
alex committed 2023-09-04 02:33:13 -07:00
1 parent 128f40bcf4
commit 3545aa076f
10 files changed
+40 -28

No files matched your search

+1 -1
View File
@@ -8,6 +8,6 @@ func fib(n) {
}
export func main() {
result = fib(20)
let result = fib(20)
println(result)
}
+15 -15
View File
@@ -1,41 +1,41 @@
export func main() {
three = 3
two = 2
let three = 3
let two = 2
calculateSimple = { in
let calculateSimple = { in
(50 + three) * two
}
calculateComplex = { in
let calculateComplex = { in
three + two + 50
}
multiply = { a, b in
let multiply = { a, b in
a * b
}
// calculates the result
calculateSimpleResult = calculateSimple()
calculateComplexResult = calculateComplex()
multiplyResult = multiply(50, 50)
let calculateSimpleResult = calculateSimple()
let calculateComplexResult = calculateComplex()
let multiplyResult = multiply(50, 50)
list = [10, 20, 30]
trueValue = true
falseValue = false
let list = [10, 20, 30]
let trueValue = true
let falseValue = false
invert = { value in
let invert = { value in
!value
}
notEqual = { a, b in
let notEqual = { a, b in
a != b
}
equal = { a, b in
let equal = { a, b in
a == b
}
results = [
let results = [
calculateSimpleResult,
calculateComplexResult,
multiplyResult,