|
mapc
|
The mapc Function applies the specified function {proc}
to each value in {vector}. The mapc function returns the
value resulting from the last mapping of the specified function. The function
{proc} must be a function that requires a single argument. When to use The mapc function is a non-destructive function that behaves like the map
with the difference being the return value is the value returned by the last function
whereas mapc returns a new copy of the Vector. It is a simpler than coding a
loop and applying a function to each Vector element. For instance, the mapc
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]))
(mapc proc vector) The result of the last invocation of the function {proc}.
Here are a number of links to Lambda coding examples which contain this instruction in various use cases.
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 proc A function requiring a single argument. Function vector Vector containing the argument values for the function {proc} Vector FltVector ShortVector IntVector NumVector
Returns:
Examples
Argument Types
Structure
Dictionary
Directory
Vector
Matrix
Pair
List
ShortVector
NumMatrix
FltVector
IntVector
NumVector
How do I contact the AIS team?