Extended pattern-matching

This commit is contained in:
Dmitry Boulytchev 2018-11-06 00:21:38 +03:00 committed by danyabeerzun
parent 99fdd176f4
commit 91f4bd6096
10 changed files with 253 additions and 45 deletions

View file

@ -27,4 +27,12 @@ case `a (1, 2, 3, 4, 5) of
| `a (_, _, _) -> write (3)
| `a (_, _, _, _) -> write (4)
| `a (_, _, _, _, _) -> write (5)
esac
esac;
write (`a (1, 2, 3, 4, 5).length);
write (`a (1, 2, 3, 4, 5)[0]);
write (`a (1, 2, 3, 4, 5)[1]);
write (`a (1, 2, 3, 4, 5)[2]);
write (`a (1, 2, 3, 4, 5)[3]);
write (`a (1, 2, 3, 4, 5)[4])