lama_byterun/stdlib/regression/test23.lama
2021-01-31 19:11:03 +03:00

15 lines
No EOL
232 B
Text

fun hd (l) {
case l of
h : _ -> h
esac
}
fun tl (l) {
case l of
_ : t -> t
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)