map

 

 

Overview

The map Function applies the specified function {proc} to each value in {vector}. The map function returns a Vector containing the result of the each mapping. The function {proc} must be a function that requires a single argument.

Structure

The map Function applies the specified function {proc} to each value in {structure}. The map function returns a structure containing the result of the each mapping. The function {proc} must be a function that requires a single argument.

Dictionary

The map Function applies the specified function {proc} to each value in {dictionary}. The map function returns a structure containing the result of the each mapping. The function {proc} must be a function that requires a single argument.

Directory

The map Function applies the specified function {proc} to each value in {directory}. The map function returns a directory containing the result of the each mapping. The function {proc} must be a function that requires a single argument.

Matrix

The map Function applies the specified function {proc} to each value in {matrix}. The map function returns a Matrix containing the result of the each mapping. The function {proc} must be a function that requires a single argument.

NumMatrix

The map Function applies the specified function {proc} to each value in {nummatrix}. The map function returns a NumMatrix containing the result of the each mapping. The function {proc} must be a function that requires a single argument.

Pair

The map Function applies the specified function {proc} to each value in the {pair}. The map function returns a List containing the result of the each mapping. The function {proc} must be a function that requires a single argument.

List

The map Function applies the specified function {proc} to each value in the {list}. The map function returns a List containing the result of the each mapping. The function {proc} must be a function that requires a single argument.

Usage

The map function is a non-destructive function useful when you want to apply a native or user-defined function to each member in a Vector. As a result, each member of the Vector may be updated by the map function without having to set up a loop and reference each field individually. For instance, the map function, with arguments of {proc} and {vector}, is equivalent to the following generic loop code:

(loop for i from 0 until (length vector) do (proc vector[i]))

Structure

The map function is a non-destructive function useful when you want to apply a native or user-defined function to each member in a Structure. As a result, each member of the Structure may be updated by the map function without having to set up a loop and reference each field individually. For instance, the map function, with arguments of {proc} and {structure}, is equivalent to the following generic loop code:

(loop for i from 0 until (length structure) do (proc structure[i]))

Dictionary

The map function is a non-destructive function useful when you want to apply a native or user-defined function to each member in a Dictionary. As a result, each member of the Dictionary may be updated by the map function without having to set up a loop and reference each field individually. For instance, the map function, with arguments of {proc} and {dictionary}, is equivalent to the following generic loop code:

(loop for i from 0 until (length dictionary) do (proc dictionary[i]))

Directory

The map function is a non-destructive function useful when you want to apply a native or user-defined function to each member in a Directory. As a result, each member of the Directory may be updated by the map function without having to set up a loop and reference each field individually. For instance, the map function, with arguments of {proc} and {directory}, is equivalent to the following generic loop code:

(loop for i from 0 until (length directory) do (proc directory[i]))

Pair

The map function is a non-destructive function useful when you want to apply a native or user-defined function to each element in a Pair. The map function is a shortcut to updating elements in a Pair or List without having to set up a loop and reference each element individually. For instance, the map function, with arguments of {proc} and {list}, is equivalent to the following generic loop code:

(loop for i from 0 until (length list) do (proc list[i]))

List

The map function is a non-destructive function useful when you want to apply a native or user-defined function to each element in a List. The map function is a shortcut to updating elements in a Pair or List without having to set up a loop and reference each element individually. For instance, the map function, with arguments of {proc} and {list}, is equivalent to the following generic loop code:

(loop for i from 0 until (length list) do (proc list[i]))

Matrix

The map function is a non-destructive function useful when you want to apply a native or user-defined function to each member in a Matrix. As a result, each Matrix element may be updated by the map function without having to set up a loop and reference each field individually. For instance, the map function, with arguments of {proc} and {matrix}, is equivalent to the following generic loop code:

(loop for i from 0 until (length matrix) do (proc matrix[i]))

NumMatrix

The map function is a non-destructive function useful when you want to apply a native or user-defined function to each member in a NumMatrix. As a result, each NumMatrix element may be updated by the map function without having to set up a loop and reference each field individually. For instance, the map function, with arguments of {proc} and {matrix}, is equivalent to the following generic loop code:

(loop for i from 0 until (length matrix) do (proc matrix[i]))

 

Syntax


Expression:

(map proc vector)


Arguments Name Type Description
Argument:proc Function A function requiring a single argument.
Argument:vector Vector FltVector ShortVector IntVector NumVector Vector containing the argument values for the function {proc}

Returns:

A new vector object containing values that have the values updated by applying the map function to each value.




Expression:

(map proc structure)


Arguments Name Type Description
Argument:proc Function A function requiring a single argument.
Argument:structure Structure Structure containing the argument values for the function {proc}

Returns:

A new structure object containing values that have the values updated by applying the map function to each value. The symbolic keys are copied as is to the new structure object.




Expression:

(map proc dictionary)


Arguments Name Type Description
Argument:proc Function A function requiring a single argument.
Argument:structure Dictionary Dictionary containing the argument values for the function {proc}

Returns:

A new dictionary object containing values that have the values updated by applying the map function to each value. The symbolic keys are copied as is to the new dictionary object.




Expression:

(map proc matrix)


Arguments Name Type Description
Argument:proc Function A function requiring a single argument.
Argument:matrix Matrix Matrix containing the argument values for the function {proc}

Returns:

A new matrix object containing values that have the values updated by applying the map function to each value.




Expression:

(map proc nummatrix)


Arguments Name Type Description
Argument:proc Function A function requiring a single argument.
Argument:nummatrix NumMatrix NumMatrix containing the argument values for the function {proc}

Returns:

A new nummatrix object containing values that have the values updated by applying the map function to each value.




Expression:

(map proc pair)


Arguments Name Type Description
Argument:proc Function A function requiring a single argument.
Argument:pair Pair A Pair containing the argument values for the function {proc}

Returns:

A new Pair object containing values that have the values updated by applying the map function to each value.




Expression:

(map proc list)


Arguments Name Type Description
Argument:proc Function A function requiring a single argument.
Argument: list List A List containing the argument values for the function {proc}

Returns:

A new List object containing values that have the values updated by applying the map function to each value.



 

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 NumMatrix Directory
Vector Matrix Pair List
ShortVector FltVector IntVector NumVector

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 class compareEQ compareGE
compareGT compareLE compareLT compareNE
compare comparison compile cons
copy count debugDetective defineStructure
defstruct delete dimension display
eval exportCsv exportSbf exportTab
fieldsOf findBlock find freeBlock
importCsv importSbf importTab insert
inside 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 macroReplace makeDictionary
makeGaussianMatrix makeGramMatrix makeQuotedList makeStructure
map mapc matrixGaussianEliminate matrixGaussianSubstitute
member methodsOf money morph
new number objectToDictionary objectToDirectory
objectToList objectToMatrix objectToNumMatrix objectToNumVector
objectToStructure objectToVector offset pair
parent parse pointer product
proplist proprecord putprop quote
rank refAttributes refValues ref
remProp remove resize reverse
saveImmediate saveObject saveRepository send
setAttributes setBlock setCar setCdr
setLastCdr setq sizeof sort
stringToBVector stringToVector string super
svmRegression type uniqueInsert 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