type/object
check for an object
Calling Sequence
Parameters
Description
Examples
type(expr, object)
expr
-
any expression
This function checks if expr is of type object.
In Maple, you typically use a prototype object to define a class, and then use instances of that class to do what you want to do with them. Internally, however, there is no difference between the two, so both are of type object. For more information on objects, see the Overview of Objects and Object Creation.
An object is a special type of module.
An object can implement a type override to allow the object to determine if it matches various types. For more information, see object/builtins.
An object can also be viewed as a type itself. By default, testing whether an expression e is of this type tests whether e is an object that has the same module definition. For more details and how to refine this test, see ModuleType.
module Obj() option object; local data := 0; export getData::static := proc( self::Obj ) self:-data; end; export setData::static := proc( self::Obj, d ) self:-data := d; end; end:
type⁡Obj,object
true
newObj1≔Object⁡Obj
newObj1≔Object<<Obj,140333615254176>>
type⁡newObj1,object
See Also
object
Object
object/builtins
object/create
type
type/module
Download Help Document