aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/inputs/backcall.mp28
1 files changed, 25 insertions, 3 deletions
diff --git a/spec/inputs/backcall.mp b/spec/inputs/backcall.mp
index a648b16..0d52f3f 100644
--- a/spec/inputs/backcall.mp
+++ b/spec/inputs/backcall.mp
@@ -2,9 +2,9 @@
2{"abc", 123, 998} |> foreach print 2{"abc", 123, 998} |> foreach print
3 3
4{1,2,3} 4{1,2,3}
5 |> map((x)-> x * 2) 5 |> map (x)-> x * 2
6 |> filter((x)-> x > 4) 6 |> filter (x)-> x > 4
7 |> reduce(0, (a,b)-> a + b) 7 |> reduce 0, (a,b)-> a + b
8 |> print 8 |> print
9 9
10[i |> tostring for i = 0,10] |> table.concat(",") |> print 10[i |> tostring for i = 0,10] |> table.concat(",") |> print
@@ -36,6 +36,28 @@ arr[3] |> f 1, 2, _, 4, 5
36 36
37a = {"1","2","3"} |> table.concat("") |> tonumber |> f1(1, 2, 3, _) |> f2(1, _, 3) 37a = {"1","2","3"} |> table.concat("") |> tonumber |> f1(1, 2, 3, _) |> f2(1, _, 3)
38 38
39readFile "example.txt"
40 |> extract _, language, {}
41 |> parse _, language
42 |> emit
43 |> render
44 |> print
45
46123 |> not func! |> f
47
48do
49 _1 = list{"abc","xyz","123"}\map"#"\value!
50 |> -func!
51 |> abc 123, _, "x"
52
53 global _2,_3,_4 = 1,2,3
54 |> f
55
56 local _5 = v |> f1 1
57 |> f2 2
58 |> f3 3
59 |> f4 4
60
39do 61do
40 (x)<- map {1,2,3} 62 (x)<- map {1,2,3}
41 x * 2 63 x * 2