Navigation
Synopsis Reverse a list.
Function list[&T] reverse(list[&T] lst)
Usage import List;
Description Returns a list with the elements of lst in reverse order.
Examples
rascal>import List;
ok
rascal>reverse([1,4,2,3]);
list[int]: [3,2,4,1]
rascal>reverse(["zebra", "elephant", "snake", "owl"]);
list[str]: ["owl","snake","elephant","zebra"]

Questions
Question [1].
The type of reverse(["Mango", "Big Bird", "Darth Sidious", "P"]) is

Question [2].
reverse([]) == 



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.