removeItem
HC
Data Structure Primitives
Mutators
removeItem
removeItem index thing
removes the indexth member of the input thing, which may be a word, list or table.
In case of thing being a list with only one member, the list will contain an empty list after removing the first member. This looks strange, but it's not possible to avoid this, except making removeItem a selector instead of a mutator, which would be much more slow.
Examples:
w="aword
removeItem 2 w
w ;aord ;-)
l=[a b c]
removeItem 2 l
l ;[a c] ;-)
removeItem 1 l
l ;[c] ;-)
removeItem 1 l
l ;[[]] ;-)
t=table 3
t'a=1234
t'b=5678
t'c=9012
removeItem "b t
t ;[a 1234][c 9012] ;-)
|
Example:
Reference: