Navigation
|
Synopsis Take the top element of a list.
Function &T top(list[&T] lst) throws EmptyList
Usage import List;
Description This function is identical to head.
Also see pop and push.
Examples rascal>import List;
ok
rascal>top([3, 1, 4, 5]);
int: 3
rascal>top(["zebra", "elephant", "snake", "owl"]);
str: "zebra"
Questions
Question [1].
Question [2].
|