mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-06 06:48:48 +00:00
27 lines
280 B
Text
27 lines
280 B
Text
|
|
local n;
|
||
|
|
|
||
|
|
fun hd (l) {
|
||
|
|
case l of
|
||
|
|
h : _ -> h
|
||
|
|
esac
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
fun tl (l) {
|
||
|
|
case l of
|
||
|
|
_ : tl -> tl
|
||
|
|
esac
|
||
|
|
}
|
||
|
|
|
||
|
|
fun print_list (l) {
|
||
|
|
case l of
|
||
|
|
{} -> skip
|
||
|
|
| h : t -> write (h); print_list (t)
|
||
|
|
esac
|
||
|
|
}
|
||
|
|
|
||
|
|
n := read ();
|
||
|
|
write ({1, 2, 3}.hd);
|
||
|
|
print_list ({1, 2, 3}.tl)
|
||
|
|
|