std-nthcdr


Synopsis

(std-nthcdr <n> <lst>)

Description

"list behind (including) the nth element"

STD-NTHCDR returns all elements after the nth element of a list, including the nth element. It's the complement to STD-FIRSTN.

Exceptional Situations

If n is 0 or negative the list is returned. If n is equal or larger than the length of the list NIL is returned.

Examples

(std-nthcdr 2 '(0 1 2 3))  => (2 3)
(std-firstn 2 '(0 1 2 3))  => (0 1)

(std-nthcdr 0 '(0 1 2 3))  => (0 1 2 3)
(std-nthcdr 4 '(0 1 2 3))  => nil
(std-nthcdr 5 '(0 1 2 3))  => nil

Arguments

n: an integer number.

lst: any proper list.

Return Value

A list.

Side Effects

None.

Module

(std-require 'STDLIST)

Defined in STDLIST