std-subseq


Synopsis

(std-subseq <lst> <start> <end>)

Description

STD-SUBSEQ extracts a sublist from a list. It returns the list including the start element until -excluding- the end element where start and end are integer indices of the list.

Exceptional Situations

It is an error if the condition (<= 0 start end (length lst)) is not true.

Examples

(std-subseq '(0 1 2 3) 1 3)  => (1 2)
(std-subseq '(0 1 2 3) 0 3)  => (0 1 2)
(std-subseq '(0 1 2 3) 0 0)  => nil
(std-subseq '(0 1 2 3) 0 -1) => error
(std-subseq '(0 1 2 3) 3 4)  => (3)
(std-subseq '(0 1 2 3) 4 5)  => error
(std-subseq '(0 1 2 3) 5 7)  => error

Arguments

start, end: integer numbers.

lst: any proper list.

Return Value

A list.

Side Effects

None.

Module

(std-require 'STDLIST)

Defined in STDLIST