YCP List Builtins


Table of Contents

add — Create a new list with a new element
change — Changes a list. Deprecated, use LIST[size(LIST)] = value.
contains — Checks if a list contains an element
filter — Filters a List
find — Searches for the first occurence of a certain element in a list
flatten — Flattens List
foreach — Processes the content of a list
isempty — Returns whether the list l is empty.
list::reduce — Reduces a list to a single value.
list::reduce — Reduces a list to a single value.
list::reverse — Creates new list with reversed order of elements.
list::swap — Creates new list with swaped elements at offset i1 and i2.
listmap — Maps an operation onto all elements of a list and thus creates a map.
lsort — Sort A List respecting locale
maplist — Maps an operation onto all elements of a list and thus creates a new list.
merge — Merges two lists into one
prepend — Prepends a list with a new element
remove — Removes element from a list
select — Selects a list element (deprecated, use LIST[INDEX]:DEFAULT)
setcontains — Checks if a sorted list contains an element
size — Returns size of list
sort — Sorts a List according to the YCP builtin predicate
sort — Sort list using an expression
splitstring — Split a string by delimiter
sublist — Extracts a sublist
sublist — Extracts a sublist
tolist — Converts a value to a list (deprecated, use (list)VAR).
toset — Sorts list and removes duplicates
union — Unions of lists