Overview Module Function Class Tea 3.2.4 Reference Documentation
© 2009 PDM&FC

Function class-is-a

class-is-a class1 class2

Checks if a class object is the same as or derived from another.

Parameters:
class1 - The TOS class object that will be checked to see if is derived from class2.
class2 - A TOS class object.
Returns:
True if class1 is the same class object as class2 or derived from class2.

A simple implementation of this function could be as follows.
define class-is-a ( class1 class2 ) {
    cond {
        same? $class1 $class2
    } $true {
        null? $class1
    } $false {
        class-is-a [class-base-of $class1] $class2
    }
}


Overview Module Function Class Tea 3.2.4 Reference Documentation
© 2009 PDM&FC
Report a bug or request new features
© 2009