XLISP >
XLISP 2.0 -
Contents -
Reference -
Previous |
Next
16 List Functions
- car - return the car of a list node
- cdr - return the cdr of a list node
- cxxr - all cxxr combinations
- cxxxr - all cxxxr combinations
- cxxxxr - all cxxxxr combinations
- first - get the first element of a list
- second - get the second element of a list
- third - get the third element of a list
- fourth - get the fourth element of a list
- rest - get the rest of the list except the first element
- cons - construct a new list node
- list - create a list of values
- append - append lists
- reverse - reverse a list
- last - return the last list node of a list
- member - find an expression in a list
- assoc - find an expression in an a-list
- remove - remove elements from a list
- remove-if - remove elements that pass test
- remove-if-not - remove elements that fail test
- length - find the length of a list, vector or string
- nth - return the nth element of a list
- nthcdr - return the nth cdr of a list
- mapc - apply function to successive cars
- mapcar - apply function to successive cars
- mapl - apply function to successive cdrs
- maplist - apply function to successive cdrs
- subst - substitute expressions
- sublis - substitute with an a-list
- (car expr)
- return the car of a list node
- expr - the list node
returns - the car of the list node
- (cdr expr)
- return the cdr of a list node
- expr - the list node
returns - the cdr of the list node
- (cxxr expr) - all cxxr combinations,
like caar, cadr and
cdar, cddr
- (cxxxr expr) - all cxxxr combinations,
like caaar...caddr
and cdaar...cdddr
- (cxxxxr expr) - all cxxxxr combinations,
like caaaar...cadddr
and cdaaar...cddddr
- (first expr)
- get the first element of a list, a synonym for
car
- (second expr)
- get the second element of a list, a synonym for
cadr
- (third expr)
- get the third element of a list, a synonym for
caddr
- (fourth expr)
- get the fourth element of a list, a synonym for
cadddr
- (rest expr)
- get the rest of the list with the first element removed, a synonym for
cdr
- (cons expr1
expr2) - construct a new list node
- expr1 - the car of the new list node
expr2 - the cdr of the new list node
returns - the new list node
- (list expr...)
- create a list of values
- expr - expressions to be combined into a list
returns - the new list
- (append expr...)
- append lists
- expr - lists whose elements are to be appended
returns - the new list
- (reverse expr)
- reverse a list
- expr - the list to reverse
returns - a new list in the reverse order
- (last list)
- return the last list node of a list
- list - the list
returns - the last list node in the list
- (member expr
list &key :test :test-not) - find an expression in a list
- expr - the expression to find
list - the list to search
:test - the test function [defaults to eql]
:test-not - the test function [sense inverted]
returns - the remainder of the list starting with the expression
- (assoc expr
alist &key :test :test-not) - find an expression in an a-list
- expr - the expression to find
alist - the association list
:test - the test function [defaults to eql]
:test-not - the test function [sense inverted]
returns - the alist entry or nil
- (remove expr
list &key :test :test-not) - remove elements from a list
- expr - the element to remove
list - the list
:test - the test function [defaults to eql]
:test-not - the test function [sense inverted]
returns - copy of list with matching expressions removed
- (remove-if test
list) - remove elements that pass test
- test - the test predicate
list - the list
returns - copy of list with matching elements removed
- (remove-if-not test
list) - remove elements that fail test
- test - the test predicate
list - the list
returns - copy of list with non-matching elements removed
- (length expr)
- find the length of a list, vector or string
- expr - the list, vector or string
returns - the length of the list, vector or string
- (nth n list)
- return the nth element of a list
- n - the number of the element to return [zero origin]
list - the list
returns - the nth element or NIL if the list isn't that long
- (nthcdr n
list) - return the nth cdr of a list
- n - the number of the element to return [zero origin]
list - the list
returns - the nth cdr or NIL if the list isn't that long
- (mapc fcn list1
list...) - apply function to successive cars
- fcn - the function or function name
listn - a list for each argument of the function
returns - the first list of arguments
- (mapcar fcn list1
list...) - apply function to successive cars
- fcn - the function or function name
listn - a list for each argument of the function
returns - a list of the values returned
- (mapl fcn list1
list...) - apply function to successive cdrs
- fcn - the function or function name
listn - a list for each argument of the function
returns - the first list of arguments
- (maplist fcn
list1 list...) - apply function to successive cdrs
- fcn - the function or function name
listn - a list for each argument of the function
returns - a list of the values returned
- (subst to from
expr &key :test :test-not) - substitute expressions
- to - the new expression
from - the old expression
expr - the expression in which to do the substitutions
:test - the test function [defaults to eql]
:test-not - the test function [sense inverted]
returns - the expression with substitutions
- (sublis alist
expr &key :test :test-not) - substitute with an a-list
- alist - the association list
expr - the expression in which to do the substitutions
:test - the test function [defaults to eql]
:test-not - the test function [sense inverted]
returns - the expression with substitutions
XLISP >
XLISP 2.0 -
Contents -
Reference -
Previous |
Next