macroReplace
|
The macroReplace function supports c-like argument substitution macros.
Up to ten arguments may be entered %1, %2, ... %9.
The final argument must be the macro template containing the argument references to be replaced.
If the argument template is a String, the function will substitute areguments and return a String.
If the argument template is a List, the function will substitute areguments and return a List.
For instance the expression, (macroReplace '(/ 1 x) 23 {(+ %1 %2)})
performs argument substitution and returns the following string: "(+ (/ 1 x) 23)".
Alternatively the expression, (macroReplace '(/ 1 x) 23 '(+ %1 %2))
performs argument substitution and returns the following List: '(+ (/ 1 x) 23).
Usage The macroReplace function is used to support c-like argument substitution macros.
It is used in connection with the defmacro special form.
(macroReplace %1 %2 ... %9 macroTemplate) Returns the macro String template with arguments substituted
Expression:
Arguments
Name
Type
Description Argument: %1 Character String Symbol Vector BitVector ByteVector IntVector Date
FltVector ObjVector Structure Brick Dictionary Directory List Void
Matrix NumMatrix Integer Float Number Complex Boolean Number Lambda
Any Lisp expression to be substituted into the String macro template Argument: %2 Character String Symbol Vector BitVector ByteVector IntVector Date
FltVector ObjVector Structure Brick Dictionary Directory List Void
Matrix NumMatrix Integer Float Number Complex Boolean Number Lambda
(Optional) Lisp expression to be substituted into the String macro template Argument: %3 Character String Symbol Vector BitVector ByteVector IntVector Date
FltVector ObjVector Structure Brick Dictionary Directory List Void
Matrix NumMatrix Integer Float Number Complex Boolean Number Lambda
(Optional) Lisp expression to be substituted into the String macro template Argument: %4 Character String Symbol Vector BitVector ByteVector IntVector Date
FltVector ObjVector Structure Brick Dictionary Directory List Void
Matrix NumMatrix Integer Float Number Complex Boolean Number Lambda
(Optional) Lisp expression to be substituted into the String macro template Argument: %5 Character String Symbol Vector BitVector ByteVector IntVector Date
FltVector ObjVector Structure Brick Dictionary Directory List Void
Matrix NumMatrix Integer Float Number Complex Boolean Number Lambda
(Optional) Lisp expression to be substituted into the String macro template Argument: %6 Character String Symbol Vector BitVector ByteVector IntVector Date
FltVector ObjVector Structure Brick Dictionary Directory List Void
Matrix NumMatrix Integer Float Number Complex Boolean Number Lambda
(Optional) Lisp expression to be substituted into the String macro template Argument: %7 Character String Symbol Vector BitVector ByteVector IntVector Date
FltVector ObjVector Structure Brick Dictionary Directory List Void
Matrix NumMatrix Integer Float Number Complex Boolean Number Lambda
(Optional) Lisp expression to be substituted into the String macro template Argument: %8 Character String Symbol Vector BitVector ByteVector IntVector Date
FltVector ObjVector Structure Brick Dictionary Directory List Void
Matrix NumMatrix Integer Float Number Complex Boolean Number Lambda
(Optional) Lisp expression to be substituted into the String macro template Argument: %9 Character String Symbol Vector BitVector ByteVector IntVector Date
FltVector ObjVector Structure Brick Dictionary Directory List Void
Matrix NumMatrix Integer Float Number Complex Boolean Number Lambda
(Optional) Lisp expression to be substituted into the String macro template Argument: macroTemplate String
A macro template containing references to arguments %1 thru %9.
The arguments are substituted with the value of the actual arguments.
Up to nine arguments can be substituted.
If the macroTemplate is a String, then a String, with the arguments substituted, will be returned.
If the macroTemplate is a List, then a List, with the arguments substituted, will be returned.
Returns:
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.
Analytic Information Server (AIS)AIS Component Systems
|