lang/interpret_test/TestAstFunc2/listlookup.txtar
raw| 1 | -- main.mcl -- |
| 2 | $l1 = ["a", "b", "c",] |
| 3 | |
| 4 | $l2 = [$l1, ["hello", "world",],] |
| 5 | |
| 6 | test [$l1[0] || "fail",] {} |
| 7 | test [$l1[2] || "fail",] {} |
| 8 | test [$l1[3] || "pass",] {} |
| 9 | test $l2[1] || ["fail",] {} |
| 10 | -- OUTPUT -- |
| 11 | Vertex: test[a] |
| 12 | Vertex: test[c] |
| 13 | Vertex: test[pass] |
| 14 | Vertex: test[hello] |
| 15 | Vertex: test[world] |