methodsOf

 

 

Overview

The methodsOf function returns the Methods Structure for a the specified class object {class}.

The Methods Structure exists for all class Structures and class Lambdas. It contains method bindings, which are the method name, and the Lambda that is associated with the method. The Methods Structure is updated any time a defmethod macro is invoked.

For instance below we define a class Lambda, create an object of the class, and then use the methodsOf function to return the class methods.

(defclass employee()
   svars:(String:Name (Number:Salary 0.0))
   cvars:(empStatic)
   (defun new(self name salary)
      (setq Name (string name))
      (setq Salary salary)
      self) ;; end of new method
   (defun talk(self)
      (writeln "I " Name " am an employee.")
      true) ;; end of talk method

   ;;.... other class methods here

   true) ;; end of employee class

(defclass employee:manager()
   svars:(String:Title)
   (defun talk(self)
      (writeln "I " Name " am a manager.")
      true) ;; end of talk method

   ;;.... other class methods here

   true) ;; end of manager class

;; Finding the class name of an object created by a class Lambda
(setq emp (new employee "John Doe" 24000.0)) ;; Create an object of class employee
(setq mgr (new manager "Chuck Bigman" 36000.0)) ;; Create an object of class manager

;; Finding the class methods of an object.
(refAttributed (methodsOf emp)) ;; returns #(obj| new talk )
((methodsOf mgr)[talk:] mgr) ;; writes on the console, "I Chuck Bigman am a manager."

Usage

Since the methodsOf function returns the Methods Structure object, it is usually used in conjunction with other functions to retrieve the information about the class Methods. The length function will determine how many methods exist for the class. The isMember function will determine if the specified method is in the Methods Structure.

 

Syntax


Expression:

(methodsOf object)


Arguments Name Type Description
Argument:objectStructure or Lambdal Must be a class Structure or a class Lambda

Returns:

The Methods Structure for that object



 

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.

Symbol Dictionary ObjectRepository

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

++ += /= *=
-- -= abortTransaction addMethod
append apply attachLibrarian beginTransaction
binaryInsert binarySearch boolean cdr
character checkPointTransaction commitTransaction compareEQ
compareGE compareGT compareLE compareLT
compareNE compare comparison compress
cons copy count debug
defchild defclass define(macro) define
defmacro defmethod deforphan defriend
defun delete detachLibrarian dimension
disassemble display downcase encode
exportCsv exportSbf exportTab gc
getGlobalValue getSymbolTable globalBinding importCsv
importSbf importTab insert inside
inspect integer isAtom isBitVector
isBoolean isBound isByteVector isCharAlphabetic
isCharAlphanumeric isCharLowercase isCharName isCharNumeric
isCharUppercase isCharWhitespace isChar isCharacter
isComplex isDate isDictionary isDirectory
isEqual isError isFloatVector isIdentical
isImmediate isInside isIntegerVector isInteger
isLambda isMatrix isMember isMoney
isNumberMatrix isNumberVector isNumber isObjectVector
isObject isPair isPcodeVector isString
isStructure isSymbol isText isTransaction
isType isVector length list
loadRepository lock macroReplace makeDictionary
makeQuotedList makeQuotedSymbol map mapc
member methodsOf money new
number objectToDictionary objectToList objectToMatrix
objectToNumMatrix objectToNumVector objectToVector offset
openLog pair parent parse
pointer proplist proprecord putprop
qt refAttributes refLibrarian refValues
ref remProp remove rename
resize saveImmediate saveObject saveRepository
setCar setCdr setLastCdr set
setf setq sizeof sort
sql string 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