isClass

 

 

Overview

The isClass function returns true if the specified argument {obj} is a class Lambda or a class Structuree; otherwise, false is returned.

For instance below we define a class Lambda, create an object of the class, and then use the isClass function to decide if the object is a class Structure.

(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 whether items saved in a Vector are class Structures
(setq vec (new Vector: 4 employee 22 emp mgr)) ;; Store several items in a Vector
(isClass vec[0]) ;; returns true
(isClass vec[1]) ;; returns false
(isClass vec[2]) ;; returns true
(isClass vec[3]) ;; returns true
(isClass vec[2] employee:) ;; returns true
(isClass vec[3] manager:) ;; returns true
(isClass vec[2] manager:) ;; returns false
(isClass vec[3] employee:) ;; returns true

Usage

The isClass function is used to determine if an object is a class Lambda or a class Structure.

 

Syntax


Expression:

(isClass obj)


Arguments Name Type Description
Argument:objStructure or Lambda An object to be tested.

Returns:

Returns true if the object is a class Lambda or a class Structure, false is returned otherwise




Expression:

(isClass obj name)


Arguments Name Type Description
Argument:objStructure or Lambda An object to be tested.
Argument:nameSymbol (Optional) The class name to be matched. Returns true of the name is equal to the class name or any class name of any parent class.

Returns:

Returns true if the object is of the class specified, false is returned otherwise



 

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.

Structure Lambda

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
boolean callcc cdr class
compareEQ compareGE compareGT compareLE
compareLT compareNE compare comparison
compile cons copy count
debugBrowsableProcs debugDetective debug defchild
defclass define(macro) defineStructure define
defmacro defmethod deforphan defriend
defstruct defun delete detachLibrarian
dimension disassemble display evalInSyncLocalContext
eval exportCsv exportSbf exportTab
fieldsOf globalBinding importCsv importSbf
importTab insert inside inspect
integer isAtom isBitVector isBoolean
isBound isByteVector 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 macroReplace makeLambda makeQuotedList
makeStructure map mapc member
money myself new number
objectToList objectToMatrix objectToNumMatrix objectToNumVector
objectToStructure objectToVector offset onError
pair parent parse pointer
proprecord putprop refAttributes refLibrarian
refValues ref remProp remove
resize saveObject send setCar
setCdr setLastCdr setq sizeof
sort string super svmRegression
type uniqueInsert 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