|
cdr
|
The cdr function is applicable to a List (a set of Pairs linked together)
and returns the tail of a List. The {repeat} argument is an optional argument
and if it is present it must be an integer which can be from 1 to 4 and indicates the
number of times to apply the cdr operator to the List. In other words
(cdr list 3) is equivalent to (cdddr list) .
The cdr function is used to retrieve the tail of a list. The cdr function can be applied sequentially up to 4 times by repeating the "d" as in cddr, cdddr, cddddr. Alternatively, the number of repeats can be specified as an argument to cdr as in (cdr list 4) is equivalent to (cddddr list 4).
(cdr list) (cddr list) (cdddr list) (cddddr list) (cdr list numRepeats) The tail of the List argument.
Here are a number of links to Lambda coding examples which contain this instruction in various use cases.
These examples show the cdr function return the tail of the List.
The second example also whos how the cdr function can be repeatedly
applied to the List argument.
Here are the links to the data types of the function arguments. Here are also a number of links to functions having arguments with any of these data types.
You can always talk with the AIS at aiserver.sourceforge.net.
Name
Description
AIS Types list A List. List numRepeats The number of times to repeat the cdr function on the List. Integer
Returns:
Examples
Argument Types
Structure
Dictionary
Directory
Vector
Brick
Symbol
Matrix
Pair
List
ShortVector
FltVector
IntVector
NumVector
ObjVector
CpxVector
BitVector
NumMatrix
How do I contact the AIS team?