mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-06 06:48:48 +00:00
Extended pattern-matching
This commit is contained in:
parent
99fdd176f4
commit
91f4bd6096
10 changed files with 253 additions and 45 deletions
|
|
@ -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])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue