|
addMethod
|
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. When to use 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.
Methods Dictionary
MsgName1 LambdaName1 MsgName2 LambdaName2 MsgName3 LambdaName3
(addMethod Character: msgName proc) The Methods Dictionary for {typeName}
Here are a number of links to Lambda coding examples which contain this instruction in various use cases.
Example_Character_addMethod_013
This example defines a method named Vowel that is invoked when
the Character type receives an isVowel message. The Vowel method
method converts the Character Value, to the English word "Yes" or to the
English word "No" depending upon whether or not the character is a vowel.
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.
You can always talk with the AIS at aiserver.sourceforge.net.
Name
Description
AIS Types Character: Mandatory keyword for specifying the Character methods table --- msgName A symbolic name of the message Symbol proc The proc to be installed ---
Returns:
Examples
Argument Types
How do I contact the AIS team?