lama_byterun/stdlib/regression/test23.lama

15 lines
232 B
Text
Raw Normal View History

2019-03-11 15:24:03 +03:00
fun hd (l) {
case l of
2021-01-31 19:11:03 +03:00
h : _ -> h
2019-03-11 15:24:03 +03:00
esac
}
fun tl (l) {
case l of
2021-01-31 19:11:03 +03:00
_ : t -> t
2019-03-11 15:24:03 +03:00
esac
}
printf ("%s\n", {1, 2, 3}.hd.string);
printf ("%s\n", {1, 2, 3, 4}.tl.string);
printf ("%s\n", {1, {2, 3, 4}, 5, 6}.tl.hd.hd.string)