bind expression (:=) instead of let
This commit is contained in:
Vendored
+1
-1
@@ -1,2 +1,2 @@
|
||||
let xs = [1, 2, 3]
|
||||
xs := [1, 2, 3]
|
||||
xs[0] + xs[1] + xs[2]
|
||||
Vendored
+1
-1
@@ -1,3 +1,3 @@
|
||||
let x = 1
|
||||
x := 1
|
||||
x = 2
|
||||
x = x + 1
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
x := 1
|
||||
y := 2
|
||||
z := x
|
||||
Vendored
+2
-2
@@ -1,4 +1,4 @@
|
||||
let xs = [1, 2, 3]
|
||||
xs := [1, 2, 3]
|
||||
len(xs)
|
||||
|
||||
first(xs)
|
||||
@@ -9,5 +9,5 @@ pop(xs)
|
||||
|
||||
len("foo")
|
||||
|
||||
let x = input()
|
||||
x := input()
|
||||
print(x)
|
||||
Vendored
+1
-1
@@ -1,2 +1,2 @@
|
||||
let f = fn(x) { fn() { x + 1 } }
|
||||
f := fn(x) { fn() { x + 1 } }
|
||||
f(2)
|
||||
Vendored
+1
-1
@@ -1,2 +1,2 @@
|
||||
let f = fn(x, y) { x * y };
|
||||
f := fn(x, y) { x * y };
|
||||
f(2, 4)
|
||||
Vendored
+1
-1
@@ -1,2 +1,2 @@
|
||||
let d = {"a": 1, "b": 2}
|
||||
d := {"a": 1, "b": 2}
|
||||
d["a"] + d["b"]
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
let x = 1
|
||||
x := 1
|
||||
if (x == 1) {
|
||||
x = 2
|
||||
x
|
||||
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
let x = 1
|
||||
let y = 2
|
||||
let z = x
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
let n = 2; let x = 0; while (n > 0) { if (n > 1) { x = x + 1 }; n = n - 1; }; x;
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
let n = 2; let x = 0; while (n > 0) { if (n > 1) { x = x + 1 }; let n = n - 1; }; x;
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
let x = 1; if (x == 1) { let x = 2 }
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
d := {"foo": 1, "bar": 2}
|
||||
|
||||
assert(d.foo == 1, "d.foo != 1")
|
||||
assert(d.bar == 2, "d.bar != 2")
|
||||
assert(d.bogus == null, "d.bogus != null")
|
||||
Vendored
+1
-1
@@ -1,2 +1,2 @@
|
||||
let s = "hello"
|
||||
s := "hello"
|
||||
s + " " + "world"
|
||||
Reference in New Issue
Block a user