|
mapc
|
The mapc Function applies the specified function {proc}
to each value in {structure}. 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.
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 Structure element. For instance, the mapc 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]))
(mapc proc structure) 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 structure Structure containing the argument values for the function {proc} Structure
Returns:
Examples
Argument Types
Structure
Dictionary
Directory
Vector
Matrix
Pair
List
ShortVector
NumMatrix
FltVector
IntVector
NumVector
How do I contact the AIS team?