Navigation
Synopsis Push an element in front of a list.
Function list[&T] push(&T elem, list[&T] lst)
Usage import List;
Description Also see pop and top.
Examples
rascal>import List;
ok
rascal>push(7, [3, 1, 4, 5]);
list[int]: [7,3,1,4,5]
rascal>push("eagle", ["zebra", "elephant", "snake", "owl"]);
list[str]: ["eagle","zebra","elephant","snake","owl"]

Questions
Question [1].
The type of push("Guava", ["Pomegranate", "W"]) is

Question [2].
push("Blackcurrant", ["Yoda", "Cumin"]) == 



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 ask.rascal-mpl.org.