|
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
MsgName1 | LambdaName1 |
MsgName2 | LambdaName2 |
MsgName3 | LambdaName3 |
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: | msgName | Symbol |
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: | msgName | Symbol |
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: | msgName | Symbol |
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: | msgName | Symbol |
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: | msgName | Symbol |
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: | msgName | Symbol |
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: | msgName | Symbol |
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: | msgName | Symbol |
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: | msgName | Symbol |
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: | msgName | Symbol |
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: | msgName | Symbol |
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: | msgName | Symbol |
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: | msgName | Symbol |
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: | msgName | Symbol |
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: | msgName | Symbol |
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: | msgName | Symbol |
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.
Here are also a number of links to functions having arguments with any of these data types.
|
Analytic Information Server (AIS)
AIS Component Systems
- Smartbase Engine
- QT C++ Libraries
- MySQL Relational Database
- AIS Lisp Libraries
- Rapid Analytic Demo IDE
|