Water 5-Type and Object System-Object System
method is_a
see if _subject has a given ancestor (_parent)
Contract
Return typewob
Parameter keyDefault valueType
ancestor_maybereq
samefalseboolean
lookuptrueboolean
Water Contract
<method is_a
  ancestor_maybe=req
  same          =false=boolean
  lookup        =true=boolean/>

See also: is_type_for

is_a allows the programmer to check whether the _subject of the call has an ancestor ( _parent ) equal to the specified ancestor_maybe parameter.

a wob
Parameter keyDefault valueType
ancestor_maybereq
This argument specifies the ancestor for which we want to test the _subject. If _subject has a parent that is the value of the ancestor_maybe argument, true is returned.

3.<is_a number />true
3.<is_a integer />true
3.14.<is_a number />true
3.14.<is_a integer />false

By default, is_a looks up through the subject's ancestor chain for a match with ancestor_maybe . Using the same and lookup parameters, a programmer can modify the behavior of the is_a method.

a wob
Parameter keyDefault valueType
samefalseboolean
If same=true, then true is also returned if _subject is the same object as given for ancestor_maybe.

a wob
same=false
<set x=3>
x.<is_a 3 />
</set>
false
a wob
same=true
<set x=3>
x.<is_a 3 same=true />
</set>
true

a wob
Parameter keyDefault valueType
lookuptrueboolean
If the lookup=true, then true is also returned if _subject has an ancestor that is the same as ancestor_maybe.

a wob
lookup=true
3.<is_a number lookup=true/>true
a wob
lookup=false
3.<is_a number lookup=false />
false