cdr

 

 

Overview

The cdr function returns the tail of the specified object.

.

List

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) .

.

Usage

The cdr function is the only function to reference the tail of a structure ,dictionary, directory, vector, Brick or matrix. The ref function will not return the tail nor will indexing with the [ ] operators return the tail.

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).

 

Syntax


Expression:

(cdr vector)


Arguments Name Type Description
Argument:vectorVector FltVector CpxVector ShortVector IntVector NumVector ObjVector BitVector The vector argument.

Returns:

If the vector contains a cdr (or tail) it will return the tail otherwise, cdr will return #void




Expression:

(cdr structure)


Arguments Name Type Description
Argument:structureStructure The Structure argument.

Returns:

If the structure contains a cdr (or tail) it will return the tail otherwise, cdr will return #void




Expression:

(cdr dict)


Arguments Name Type Description
Argument:dictDictionary The Dictionary argument.

Returns:

If the dictionary contains a cdr (or tail) it will return the tail otherwise, cdr will return #void




Expression:

(cdr directory)


Arguments Name Type Description
Argument:directoryDirectory The directory argument.

Returns:

If the directory contains a cdr (or tail) it will return the tail otherwise, cdr will return #void




Expression:

(cdr brick)


Arguments Name Type Description
Argument:brickBrick The brick argument.

Returns:

If the Brick contains a cdr (or tail) it will return the tail otherwise, cdr will return #void




Expression:

(cdr matrix)


Arguments Name Type Description
Argument:matrixMatrix The matrix argument.

Returns:

If the Matrix contains a cdr (or tail) it will return the tail otherwise, cdr will return #void




Expression:

(cdr nummatrix)


Arguments Name Type Description
Argument:matrixNumMatrix The matrix argument.

Returns:

If the NumMatrix contains a cdr (or tail) it will return the tail otherwise, cdr will return #void




Expression:

(cdr list)

(cddr list)

(cdddr list)

(cddddr list)

(cdr list numRepeats)


Arguments Name Type Description
Argument:listList A List.
Argument:numRepeatsInteger The number of times to repeat the cdr function on the List.

Returns:

The tail of the List argument.



 

Examples

Here are a number of links to Lambda coding examples which contain this instruction in various use cases.

 

Argument Types

Here are the links to the data types of the function arguments.

Structure Dictionary Directory Vector
Brick Symbol Matrix Pair
List ShortVector FltVector IntVector
NumVector ObjVector CpxVector BitVector
NumMatrix

Here are also a number of links to functions having arguments with any of these data types.

++ += /= *=
-- -= addMethod appendWriteln
append apply associate binaryInsert
binarySearch bitToIntegerVector bitToNumberVector boolean
c::r car cdr character
class compareEQ compareGE compareGT
compareLE compareLT compareNE compare
comparison compile compress cons
copy count debugDetective debug
defchild defclass define(macro) defineStructure
define defmacro defmethod deforphan
defriend defstruct defun deleteRows
delete dimension disassemble display
downcase encode eval exportCsv
exportSbf exportTab fieldsOf findBlock
find freeBlock gc getGlobalValue
getSymbolTable globalBinding importCsv importSbf
importTab insertRows insert inside
inspect integer isAtom isBitVector
isBoolean isBound isByteVector isCharAlphabetic
isCharAlphanumeric isCharLowercase isCharName isCharNumeric
isCharUppercase isCharWhitespace isChar isCharacter
isClass isComplex isDate isDictionary
isDirectory isEqual isError isFloatVector
isIdentical isInside isIntegerVector isInteger
isLambda isMatrix isMember isMoney
isNumberMatrix isNumberVector isNumber isObjectVector
isObject isPair isPcodeVector isString
isStructure isSymbol isText isType
isVector last length lisp
list loadRepository lock macroReplace
makeDictionary makeGaussianMatrix makeGramMatrix makeQuotedList
makeQuotedSymbol makeStructure map mapc
matrixGaussianEliminate matrixGaussianSubstitute member methodsOf
money morph new number
objectToDictionary objectToDirectory objectToList objectToMatrix
objectToNumMatrix objectToNumVector objectToStructure objectToVector
offset openLog pair parent
parse pointer product proplist
proprecord putprop qt quote
rank refAttributes refValues ref
remProp remove rename resize
reverse saveImmediate saveObject saveRepository
send setAttributes setBlock setCar
setCdr setLastCdr set setf
setq sizeof sort sql
stringToBVector stringToVector string super
svmRegression symbolToTypeCode symbol type
uniqueInsert unlock vectorBinaryInnerProduct vectorBipolarInnerProduct
vectorCosineInnerProduct vectorCubeInnerProduct vectorDelete vectorExpInnerProduct
vectorFill vectorInnerProduct vectorLogInnerProduct vectorQuartInnerProduct
vectorQuintInnerProduct vectorSigmoidInnerProduct vectorSineInnerProduct vectorSquareInnerProduct
vectorTanInnerProduct vectorTanhInnerProduct writelg writeln

Analytic Information Server (AIS)

AIS Component Systems

  • Smartbase Engine
  • QT C++ Libraries
  • MySQL Relational Database
  • AIS Lisp Libraries
  • Rapid Analytic Demo IDE