std-delpos


Synopsis

(std-delpos <i> <lst>) ; delete at position

Description

STD-DELPOS returns a list without the i'th element. It is used to remove elements only at a certain position in the list, often in conjunction with STD-POSITION. It is not destructive, it always returns a copy.

STD-DELPOS removes by position, STD-REMOVE by value, STD-REMOVE may also remove all duplicate elements, STD-DELPOS only one.

Exceptional Situations

If the index i is invalid (out of range) the original list is returned.

Examples

(std-delpos 0 '(1 2))  => (2)
(std-delpos 1 '(1 2))  => (1)
(std-delpos 2 '(1 2))  => (1 2)
(std-delpos -1 '(1 2)) => (1 2)

Arguments

i: an integer number.

lst: any proper list.

Return Value

A list.

Side Effects

None.

Module

(std-require 'STDLIST)

Defined in STDLIST