select — Selects a list element (deprecated, use LIST[INDEX]:DEFAULT)
any
select
( | list LIST , |
integer INDEX , | |
any
DEFAULT
) ; |
Gets theINDEX
'th value of a list. The first value has the index 0. The call select([1,2,3], 1) thus returns 2. ReturnsDEFAULT
if the index is invalid or if the found entry has a different type than the default value. Functionality replaced by syntax: list numbers = [1, 2, 3, 4]; numbers[2]:nil -> 3 numbers[8]:5 -> 5