Synopsis Pop top element from list, return a tuple.
Function tuple[&T, list[&T]] pop(list[&T] lst) throws EmptyList
Usage import List;
Description This function is identical to headTail. Also see push and top.
rascal>import List;
rascal>pop([3, 1, 4, 5]);
tuple[int,list[int]]: <3,[1,4,5]>
rascal>headTail([3, 1, 4, 5]);
tuple[int,list[int]]: <3,[1,4,5]>
rascal>pop(["zebra", "elephant", "snake", "owl"]);
tuple[str,list[str]]: <"zebra",["elephant","snake","owl"]>

Question [1].
The type of pop(["Blueberry", "Pomegranate", "M", "Mandarin"]) is

Question [2].
pop(["Rosemary", "Raspberry"]) == 

Is this page unclear, or have you spotted an error? Please add a comment below and help us to improve it. For all other questions and remarks, visit