List Manipulation Functions

AutoCAD AutoLISP & Visual LISP

 
List Manipulation Functions
 
 
 

The following table provides summary descriptions of the AutoLISP list manipulation functions.

List manipulation functions

Function

Description

(acad_strlsortlst)

Sorts a list of strings by alphabetical order

(appendlst ...)

Takes any number of lists and runs them together as one list

(associtem alist)

Searches an association list for an element and returns that association list entry

(carlst)

Returns the first element of a list

(cdrlst)

Returns the specified list, except for the first element of the list

(consnew-first-element lst)

The basic list constructor

(foreachname lst [expr ...])

Evaluates expressions for all members of a list

(lastlst)

Returns the last element in a list

(lengthlst)

Returns an integer indicating the number of elements in a list

(list [expr ...])

Takes any number of expressions and combines them into one list

(listpitem)

Verifies that an item is a list

(mapcarfunctionlist1 ... listn)

Returns a list of the result of executing a function with the individual elements of a list or lists supplied as arguments to the function

(memberexpr lst)

Searches a list for an occurrence of an expression and returns the remainder of the list, starting with the first occurrence of the expression

(nthn lst)

Returns the nth element of a list

(reverselst)

Returns a list with its elements reversed

(substnewitem olditem lst)

Searches a list for an old item and returns a copy of the list with a new item substituted in place of every occurrence of the old item

(vl-consp list-variable)

Determines whether or not a list is nil

(vl-everypredicate-functionlist [more-lists]...)

Checks whether the predicate is true for every element combination

(vl-list*object [more-objects]...)

Constructs and returns a list

(vl-list->stringchar-codes-list)

Combines the characters associated with a list of integers into a string

(vl-list-lengthlist-or-cons-object)

Calculates list length of a true list

(vl-member-ifpredicate-function list)

Determines whether the predicate is true for one of the list members

(vl-member-if-notpredicate-function list)

Determines whether the predicate is nil for one of the list members

(vl-positionsymbol list)

Returns the index of the specified list item

(vl-removeelement-to-remove

list)

Removes elements from a list

(vl-remove-ifpredicate-functionlist)

Returns all elements of the supplied list that fail the test function

(vl-remove-if-notpredicate-functionlist)

Returns all elements of the supplied list that pass the test function

(vl-somepredicate-functionlist [more-lists]...)

Checks whether the predicate is not nil for one element combination

(vl-sortlist less?-function)

Sorts the elements in a list according to a given compare function

(vl-sort-ilist less?-function)

Sorts the elements in a list according to a given compare function, and returns the element index numbers

(vl-string->liststring)

Converts a string into a list of character codes