|
Example Vector mapc 004
|
Description
The following example will define a user function, makePlural,
that will take an argument (which is a Vector value).
The mapc function then applies each Vector value
as argument to the function makePlural.
Details
Define a Vector containing various fruit names:
| (define Fruits #("apple" "orange" "lemon") )
|
Returns: #<Vector 123456>
|
Define a function that takes a single Vector argument and converts each vector member to plural.
| (defun makePlural (V) (append V "s"))
|
Returns: #<Lambda 123456>
|
| (setq many (mapc makePlural Fruits) )
|
Returns: lemons
|
Notes and Hints
The mapc function does not produce a duplicate Directory as in
the map function.
Related Examples
Here are examples of the mapc function at work.
Function Links
Here is the link to the current function used in this example.
mapc
Here are a number of links to other related functions.
Argument Types
Here are the links to the data types of the arguments used in this example.
Here are a number of links to examples having similar argument types.
|
Analytic Information Server (AIS)
AIS Component Systems
- Smartbase Engine
- QT C++ Libraries
- MySQL Relational Database
- AIS Lisp Libraries
- Rapid Analytic Demo IDE
|