object is type
The operator checks if left operand is an object of specified type and returns bool value (true/false). It is handy to use the operator in cases when a variable may contain a single value or a set of values (hash), as well as to check if a method is defined.
@print_date[year;month;day]
Working with date:<br />
Day: $day<br />
Month: $month<br />
Year: $year<br />
This example will check the type of variable $date and will either perform syntactical analysis or pass to method print_date the fields of $date (if type is object of class date). Checking if method is defined
The value of $method_name is also junction, that is why we should also use is and not def in this case.
@body[]
body
@main[]
Start
^if($body is junction){
^body[]
}{
Method "body" is not defined!
}
Finish
Note: using operator is you can't check variables which contains code because of any address to such variables execute the code.
For such check ^reflection:is[] should be used.