addMethod

 

 

Overview

The addMethod function associates a method {proc} to the specified type {type} that responds to a nessage {msgName}. This function is instrumental in providing Analytic Information Server with support for standard Object Oriented Programming features. After the addMethod associates a method {methodName} with the specified type {type}, the {methodName} can be used as if it was a native Analytic Information Server function for a that type.

The Analytic Information Server Lisp compiler constructs a method binding from the {methodName} argument and the Lambda object defined in the argument {proc}. The new method binding is installed in the methods Dictionary associated with the specified type {type}. In summary, the defmethod creates a new method binding for a type (can be any Analytic Information Server type or user defined type) . The addmethod function returns the Methods Dictionary object.

Methods Dictionary

MsgName1LambdaName1
MsgName2LambdaName2
MsgName3LambdaName3

Usage

Use the addMethod function to define a method (Lambda) that operates differently on Strings than it does on other types. This allows the standard type polymorphism of standard Object Oriented Programming (OOP). Analytic Information Server supports both standard OOP type polymorphism and Lambda polymorphism.

 

Syntax


Expression:

(addMethod VectorType: msgName proc)


Arguments Name Type Description
Argument:VectorType:CpxVector FltVector IntVector NumVector ObjVector PcodeVector BitVector ShortVector Mandatory keyword for specifying the Vector methods table. It may be a Vector or any of its subtypes (e.g. Vector:, NumVector:, IntVector:, ...)
Argument:msgNameSymbol A symbolic name of the message
Argument:proc--- The proc to be installed

Returns:

The Methods Dictionary for {typeName}




Expression:

(addMethod String: methodName proc)

(addMethod Text: methodName proc)


Arguments Name Type Description
Argument:proc--- The proc to be installed

Returns:

The Methods Dictionary for String:




Expression:

(addMethod Symbol: msgName proc)


Arguments Name Type Description
Argument:proc--- The proc to be installed

Returns:

The Methods Dictionary for Symbol:




Expression:

(addMethod Structure: msgName proc)


Arguments Name Type Description
Argument:msgNameSymbol A symbolic name of the message

Returns:

The Methods Dictionary for {typeName}




Expression:

(addMethod Dictionary: msgName proc)


Arguments Name Type Description
Argument:Dictionary:--- Mandatory keyword for specifying the Dictionary methods table
Argument:msgNameSymbol A symbolic name of the message
Argument:proc--- The proc to be installed

Returns:

The Methods Dictionary for {typeName}




Expression:

(addMethod Directory: msgName proc)


Arguments Name Type Description
Argument:Directory:--- Mandatory keyword for specifying the Directory methods table
Argument:msgNameSymbol A symbolic name of the message
Argument:proc--- The proc to be installed

Returns:

The Methods Dictionary for {typeName}




Expression:

(addMethod Brick: msgName proc)


Arguments Name Type Description
Argument:Brick:--- Mandatory keyword for specifying the Brick methods table
Argument:msgNameSymbol A symbolic name of the message
Argument:proc--- The proc to be installed

Returns:

The Methods Dictionary for {typeName}




Expression:

(addMethod Matrix: msgName proc)


Arguments Name Type Description
Argument:Matrix:--- Mandatory keyword for specifying the Matrix methods table
Argument:msgNameSymbol A symbolic name of the message
Argument:proc--- The proc to be installed

Returns:

The Methods Dictionary for {typeName}




Expression:

(addMethod NumMatrix: msgName proc)


Arguments Name Type Description
Argument:NumMatrix:--- Mandatory keyword for specifying the Matrix methods table
Argument:msgNameSymbol A symbolic name of the message
Argument:proc--- The proc to be installed

Returns:

The Methods Dictionary for {typeName}




Expression:

(addMethod Pair: msgName proc)


Arguments Name Type Description
Argument:Pair:--- Mandatory keyword for specifying the Pair methods table
Argument:msgNameSymbol A symbolic name of the message
Argument:proc--- The proc to be installed

Returns:

The Methods Dictionary for {typeName}




Expression:

(addMethod List: msgName proc)


Arguments Name Type Description
Argument:Pair:--- Mandatory keyword for specifying the List methods table
Argument:msgNameSymbol A symbolic name of the message
Argument:proc--- The proc to be installed

Returns:

The Methods Dictionary for {typeName}




Expression:

(addMethod Void: msgName proc)


Arguments Name Type Description
Argument:Void:--- Mandatory keyword for specifying the Void methods table
Argument:msgNameSymbol A symbolic name of the message
Argument:proc--- The proc to be installed

Returns:

The Methods Dictionary for {typeName}




Expression:

(addMethod Boolean: msgName proc)


Arguments Name Type Description
Argument:Boolean:--- Mandatory keyword for specifying the Boolean methods table
Argument:msgNameSymbol A symbolic name of the message
Argument:proc--- The proc to be installed

Returns:

The Methods Dictionary for {typeName}




Expression:

(addMethod Character: msgName proc)


Arguments Name Type Description
Argument:Character:--- Mandatory keyword for specifying the Character methods table
Argument:msgNameSymbol A symbolic name of the message
Argument:proc--- The proc to be installed

Returns:

The Methods Dictionary for {typeName}




Expression:

(addMethod Number: msgName proc)


Arguments Name Type Description
Argument:Number:--- Mandatory keyword for specifying the Number methods table
Argument:msgNameSymbol A symbolic name of the message
Argument:proc--- The proc to be installed

Returns:

The Methods Dictionary for {typeName}




Expression:

(addMethod Date: msgName proc)


Arguments Name Type Description
Argument:Date:--- Mandatory keyword for specifying the Date methods table
Argument:msgNameSymbol A symbolic name of the message
Argument:proc--- The proc to be installed

Returns:

The Methods Dictionary for {typeName}




Expression:

(addMethod Function: msgName proc)


Arguments Name Type Description
Argument:Function:--- Mandatory keyword for specifying the Function methods table
Argument:msgNameSymbol A symbolic name of the message
Argument:proc--- The proc to be installed

Returns:

The Methods Dictionary for {typeName}




Expression:

(addMethod ObjectRepository: msgName proc)


Arguments Name Type Description
Argument:ObjectRepository:--- Mandatory keyword for specifying the ObjectRepository methods table
Argument:msgNameSymbol A symbolic name of the message that the Object Repository will respond.
Argument:proc--- The proc to be installed

Returns:

The Methods Dictionary for {typeName}



 

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.

String Text Dictionary Symbol
Structure Dictionary Number Function
CpxVector Directory Vector Brick
Matrix Pair Void Boolean
Character Date ObjectRepository FltVector
IntVector NumVector ObjVector PcodeVector
BitVector ByteVector

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

++ += + /=
/ *= * --
-= - abortTransaction abs
acos add1 addMethod addi
appendWriteln append apply argument
arithmetic asin associate atan
attachLibrarian avg badd balance
bcompareEQ bcompareGE bcompareGT bcompareLE
bcompareLT bcompareNE bdiv beginTransaction
binaryInsert binaryNand binaryNor binaryNot
binaryNxor binarySearch bitToIntegerVector bitToNumberVector
bitwiseAnd bitwiseNand bitwiseNor bitwiseNot
bitwiseNxor bitwiseOr bitwiseShiftLeft bitwiseShiftRight
bitwiseXor bmod bmul boolean
cadd callcc car ccompareEQ
ccompareGE ccompareGT ccompareLE ccompareLT
ccompareNE cdiv cdr char
character checkPointTransaction class clean
clear closeLog cmod cmul
code commitTransaction compareEQ compareGE
compareGT compareLE compareLT compareNE
compare comparison compile compress
cons copy cos cosh
count csub date day
days360 debugBrowsableProcs debugDetective debugEval
debug decode defchild defclass
define(macro) defineStructure define defmacro
defmethod deforphan defriend defstruct
defun deg deleteRows delete
detachLibrarian dimension disassemble display
divi downcase encode evalInSyncLocalContext
eval exp exportCsv exportSbf
exportTab expt fact fdisplay
fieldsOf fileClose fileCopy fileDir
fileDisplay fileEraseDir fileErase fileExists
fileMakeDir fileOpen fileReadAll fileReadRecord
fileRead fileSizeOf fileWriteAll fileWrite
filewriteln findBlock find floor
fraction freeBlock gc getGlobalValue
getSymbolTable getTickCount globalBinding hashString
hour iadd icompareEQ icompareGE
icompareGT icompareLE icompareLT icompareNE
idiv imod importCsv importSbf
importTab imul insertRows insert
inside inspect integer isAtom
isBitVector isBoolean isBound isByteVector
isCharAlphabetic isCharAlphanumeric isCharLowercase isCharName
isCharNumeric isCharUppercase isCharWhitespace isChar
isCharacter isClass isComplex isDate
isDictionary isDirectory isEqual isError
isEven isExact isFloatVector isIdentical
isImmediate isInexact isInside isIntegerVector
isInteger isLambda isMatrix isMember
isMoney isNegative isNull isNumberMatrix
isNumberVector isNumber isObjectVector isObject
isOdd isPair isPcodeVector isPositive
isString isStructure isSymbol isText
isTransaction isType isVector isZero
isub julian kurtosis last
left length lisp list
loadModule loadObject loadRepository loadWorkspace
lock log10 log2 logConsole
log logbase macroReplace makeDictionary
makeGramMatrix makeQuotedList makeQuotedSymbol makeStructure
map mapc max median
member methodsOf mid min
minute mod modi money
month morph muli nadd
ncompareEQ ncompareGE ncompareGT ncompareLE
ncompareLT ncompareNE ndiv new
nmod nmul now nsub
number objectToDictionary objectToDirectory objectToList
objectToMatrix objectToNumMatrix objectToNumVector objectToStructure
objectToVector offset onError openLog
pair parent parse pi
pointer product proplist proprecord
putprop qt quit rad
random randomize range rank
refAttributes refLibrarian refValues ref
remProp remove rename replace
rept reset resize reverse
right round run saveImmediate
saveModule saveObject saveRepository saveWorkspace
second send setAttributes setBlock
setCar setCdr setLastCdr set
setf setq sigmoid sign
sin sinh sizeof skew
sleep sort sql sqrt
srandom stdev stdevp stringCiEQ
stringCiGE stringCiGT stringCiLE stringCiLT
stringCiNE stringFill stringToBVector stringToVector
string sub1 subi submit
substitute substringCiEQ substringCiGE substringCiGT
substringCiLE substringCiLT substringCiNE substringEQ
substringFill substringGE substringGT substringLE
substringLT substringNE substring sum
sumsqr super svmRegression symbolToTypeCode
symbol systemCheck system tan
tanh text time today
trim type uncompress uniqueInsert
unlock upcase var varp
vectorBinaryInnerProduct vectorBipolarInnerProduct vectorCosineInnerProduct vectorCubeInnerProduct
vectorDelete vectorExpInnerProduct vectorFill vectorInnerProduct
vectorLogInnerProduct vectorQuartInnerProduct vectorQuintInnerProduct vectorSigmoidInnerProduct
vectorSineInnerProduct vectorSquareInnerProduct vectorTanInnerProduct vectorTanhInnerProduct
version writelg writeln year

Analytic Information Server (AIS)

AIS Component Systems

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