Navigation
Synopsis Drop elements from the head of a list.
Function list[&T] drop(int n, list[&T] lst)
Usage import List;
Description Drop n elements (or size(lst) elements if size(lst) < n) from the head of lst. See take to get elements from the head of a list].
Examples
rascal>import List;
ok
rascal>drop(2, [5, 1, 7, 3]);
list[int]: [7,3]
rascal>drop(10, [5, 1, 7, 3]);
list[int]: []
rascal>drop(2, ["zebra", "elephant", "snake", "owl"]);
list[str]: ["snake","owl"]

Questions
Question [1]. Dropping n elements from a list returns a list with






Question [2].
The type of drop(2, [false, true, false, true, false]) is

Question [3].
drop(2, [6, 7, 19, 3, 0]) == 



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.