defmacro

 

 

Overview

The defmacro macro creates a Macro object, assigns it to the specified variable {name} in the global environment, and returns the newly created Macro object. The new Macro object is assigned to the specified global variable name {name} , and will be invoked by the morph function during the macro substitution phase of compilation (see the lisp, morph, and compile functions). The defmacro macro results in the following substitution:

(define macro: (name arg...) faces:(var...) vars:(var...) pvars:(var...) cvars:(var...) regs:(var...) exp...)

Usage

Use the define macro: function when you wish to create an in-line macro, which expands its arguments, rather than invoking a function call.

 

Syntax


Expression:

(defmacro name(arg...) faces:(vars...) vars:(var...) pvars:(var...) cvars:(var...) regs:(var...) exp...)


Arguments Name Type Description
Argument:nameSymbol The name that the Lambda will be associated with.
Argument:(arg...)--- Optional Argument. Argument list for the Lambda.
Argument:faces:(var...)Symbol Optional Argument. If present, must be followed by a interfaces feature list.
Argument:vars:(var...)Symbol Optional Argument. If present, must be followed by a local variable list.
Argument:pvars:(var...)Symbol Optional Argument. If present, must be followed by a persistent variable list.
Argument:cvars:(var...)Symbol Optional Argument. If present, must be followed by a persistent class variable list.
Argument:regs:(var...)Symbol Optional Argument. If present, must be followed by a register variable list (up to fifty register variables are allowed).
Argument:exp...--- The Lisp statements that forms the Lambdas

Returns:

An Lambda that will be assigned the name {name}.



 

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.

Lambda Symbol

Here are also a number of links to functions having arguments with any of these data types.

++ += /= *=
-- -= addMethod append
apply argCount argFetch attachLibrarian
balance binaryInsert binarySearch boolean
callcc cdr character class
compareEQ compareGE compareGT compareLE
compareLT compareNE compare comparison
compile compress cons copy
count debugBrowsableProcs debug defchild
defclass define(macro) define defmacro
defmethod deforphan defriend defun
delete detachLibrarian dimension disassemble
display downcase encode evalInSyncLocalContext
eval exportCsv exportSbf exportTab
gc getGlobalValue getSymbolTable globalBinding
importCsv importSbf importTab insert
inside inspect integer isAtom
isBitVector isBoolean 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 lambda length lisp
list lock macroReplace makeLambda
makeQuotedList makeQuotedSymbol member methodsOf
money myself new number
offset onError openLog pair
parent parse pointer proplist
proprecord putprop qt refLibrarian
ref remProp remove rename
saveObject saveRepository send setCar
setCdr setLastCdr set setf
setq sizeof sql string
super svmRegression symbolToTypeCode symbol
type uniqueInsert unlock vectorFill
writelg writeln

Analytic Information Server (AIS)

AIS Component Systems

  • Smartbase Engine
  • QT C++ Libraries
  • MySQL Relational Database
  • AIS Lisp Libraries
  • Rapid Analytic Demo IDE