List notations/pattern matching

This commit is contained in:
Dmitry Boulytchev 2019-03-07 21:12:43 +03:00
parent 4879a02753
commit e16fb72a9e
8 changed files with 128 additions and 20 deletions

View file

@ -0,0 +1,4 @@
0
{1, 2, 3, 4}
{{1}, {2, 3}, {4, {5, 6}}}
{1, 2, 3, 4}

View file

@ -0,0 +1,10 @@
lists := [
{},
{1, 2, 3, 4},
{{1}, {2, 3}, {4, {5, 6}}},
1 : 2 : 3 : 4 : {}
];
for i := 0, i<lists.length, i:=i+1 do
printf ("%s\n", lists[i].string)
od

View file

@ -0,0 +1 @@
0