Variety: |
procedure |
Syntax: |
end_class() |
Contexts: |
Class definition. |
Description: |
Ends the current class definition and verifies the definition. Automatically calls the class' Initialize#0 class method. |
Errors: |
Program termination if:
|
Variety: |
type |
Syntax: |
boolean1=entity(object1) |
Contexts: |
All. |
Description: |
Returns TRUE if object1 is an entity, otherwise FALSE. |
Errors: |
None. |
Variety: |
procedure |
Syntax: |
error_screen_width(object1) |
Contexts: |
All. |
Description: |
Sets the width of the error screen for formatting of termination messages issued by fatal_error() to object1. If object1 is not an integer or is less than 20 the setting is unchanged. (The initial width is 80.) |
Errors: |
None. |
Variety: |
procedure |
Syntax: |
event(identifier1,integer1,integer2, object1,object2) |
Context: |
Class definition. |
Description: |
Defines an event named identifier1 in the class currently being defined. Integer1 specifies the number of parameters. Integer2 is INSTANCE or CLASS to specify the event's target. Object1 is either an integer which specifies PUBLIC, PROTECTED, or PRIVATE link access or a two-element sequence: the first element is an integer which specifies link access, the second element is the routine id of the property's linker function. Object2 is either an integer which specifies PUBLIC, PROTECTED, or PRIVATE raise access or a two-element sequence: the first element is an interger which specifies write raise access, the second element is the routine id of the property's raiser function. |
Errors: |
Program termination if:
|
Variety: |
constant |
Description: |
Possible return value of class_type(). |
Variety: |
function |
Syntax: |
class_entity1=exception(identifier1,object1) |
Contexts: |
Main program; no pending exception. |
Description: |
Defines an exception with the name identifier1. Object1 is a class entity or sequence of class entities (possibly empty) which designates the superclass of superclasses. If object1 is an empty sequence, Exception will be the superclass. Returns the new exception's handle. |
Note: |
It is strongly recommended to assign class_entity1 to a global constant. The exception() function is a shorthand means of defining exceptions: it calls class() and end_class() internally and error messages may reference those routines. |
Errors: |
Program termination if:
|
Variety: |
function |
Syntax: |
boolean1=extends(object1,object2) |
Contexts: |
All. |
Description: |
Returns TRUE object1 and object2 are entities and object1's class is the same as object2's class or a subclass of object2's class; otherwise returns FALSE. |
Errors: |
None. |
Variety: |
constant |
Description: |
The integer 0, used as a boolean value. |
Variety: |
procedure |
Syntax: |
fatal_error(string1) |
Contexts: |
All. |
Description: |
Terminates the program with an error message. Word wraps the error message based on width of the error screen; this defaults to 80, and can be set by error_screen_width(). Also calls debug_file(). The error message consists of:
|
Errors: |
None. |
Variety: |
constant |
Description: |
Used in class() or method() to specify a final class or method. |
Variety: |
function |
Syntax: |
sequence1=get_class(object1) |
Contexts: |
All. |
Description: |
If object1 is an instance entity, returns the handle of the entity's class. If object1 is a class entity, returns object1. If object1 is not an entity, returns Null_Class. |
Errors: |
None. |
Variety: |
function |
Syntax: |
object1=get_property(entity1,identifier1) |
Contexts: |
Main program, method, event. |
Description: |
If entity1 is an instance, returns the instance property named identifier1 of the instance. If entity1 is a class, returns the class property named identifier1 of the class. If a getter has been defined for this property, passes the current property value to the getter and returns the getter's return value. See Accessors. |
Errors: |
Program termination if:
|
Variety: |
type |
Syntax: |
boolean1=identifier(object1) |
Contexts: |
All. |
Description: |
Returns TRUE if object1 is a string which is a valid Euphoria identifier: the first character is a letter and all of the other characters are letters, digits, and underscores; otherwise FALSE. |
Errors: |
None. |
Variety: |
function |
Syntax: |
boolean1=implements(object1,object2) |
Contexts: |
All. |
Description: |
Returns TRUE if object1 is an entity, object2 is an interface, and object1's class implements that interface, directly or by inheritance; otherwise returns FALSE. |
Errors: |
None. |
Variety: |
constant |
Description: |
Used in property(), method(), or event() to indicate an instance property, method, or event. |
Variety: |
type |
Syntax: |
boolean1=instance_entity(object1) |
Contexts: |
All. |
Description: |
Returns TRUE if object1 is an instance entity; returns FALSE if object1 is a class entity or is not an entity.. |
Errors: |
None. |
Variety: |
constant |
Description: |
Possible return value of class_type(). |
Variety: |
function |
Syntax: |
class_entity1=interface(identifier1, object1,object2,object3) |
Contexts: |
Main program; no pending exception. |
Description: |
Defines an interface named identifier1. Object1 is an interface or a (possibly empty) sequence of interfaces, which are the superclasses of the new interface. Object2 and object3 are single methods or (possibly empty) sequences of methods to be implemented by classes which implement the interface; object2 is for instance methods, object3 is for class methods. Methods may be listed in either of two forms: {"MethodName",2} or "MethodName#2". |
Note: |
It is strongly recommended to assign class_entity1 to a global constant. The interface() function is a shorthand means of defining interfaces: it calls class(), method(), and end_class() internally and error messages may reference those routines. |
Errors: |
Program termination if:
|
Variety: |
function |
Syntax: |
boolean1=is_atom(object1) |
Contexts: |
Main program, method, event; no pending exception (except Type_Check_Failure). |
Description: |
If object1 is not an atom, throws Type_Check_Failure. Returns TRUE. |
Errors: |
None. |
Variety: |
function |
Syntax: |
boolean1=is_boolean(object1) |
Contexts: |
Main program, method, event; no pending exception (except Type_Check_Failure). |
Description: |
If object1 is not a boolean, throws Type_Check_Failure. Returns TRUE. |
Errors: |
None. |
Variety: |
function |
Syntax: |
boolean1=is_class(object1) |
Contexts: |
Main program, method, event; no pending exception (except Type_Check_Failure). |
Description: |
If object1 is not a class, throws Type_Check_Failure. Returns TRUE. |
Errors: |
None. |
Variety: |
function |
Syntax: |
boolean1=is_entity(object1) |
Contexts: |
Main program, method, event; no pending exception (except Type_Check_Failure). |
Description: |
If object1 is not an entity, throws Type_Check_Failure. Returns TRUE. |
Errors: |
None. |
Variety: |
function |
Syntax: |
boolean1=is_identifier(object1) |
Contexts: |
Main program, method, event; no pending exception (except Type_Check_Failure). |
Description: |
If object1 is not an identifier, throws Type_Check_Failure. Returns TRUE. |
Errors: |
None. |
Variety: |
function |
Syntax: |
boolean1=is_instance(object1) |
Contexts: |
Main program, method, event; no pending exception (except Type_Check_Failure). |
Description: |
If object1 is not an instance, throws Type_Check_Failure. Returns TRUE. |
Errors: |
None. |
Variety: |
function |
Syntax: |
boolean1=is_integer(object1) |
Contexts: |
Main program, method, event; no pending exception (except Type_Check_Failure). |
Description: |
If object1 is not an integer, throws Type_Check_Failure. Returns TRUE. |
Errors: |
None. |
Variety: |
function |
Syntax: |
boolean1=is_live_instance(object1) |
Contexts: |
Main program, method, event; no pending exception (except Type_Check_Failure). |
Description: |
If object1 is not an instance entity or if object1 has been deleted, throws Type_Check_Failure. Returns TRUE. |
Errors: |
None. |
Variety: |
function |
Syntax: |
boolean1=is_object(object1) |
Contexts: |
Main program, method, event; no pending exception (except Type_Check_Failure). |
Description: |
If object1 is an entity, throws Type_Check_Failure. Returns TRUE. |
Errors: |
None. |
Variety: |
function |
Syntax: |
boolean1=is_sequence(object1) |
Contexts: |
Main program, method, event; no pending exception (except Type_Check_Failure). |
Description: |
If object1 is not a sequence or is an entity, throws Type_Check_Failure. Returns TRUE. |
Errors: |
None. |
Variety: |
function |
Syntax: |
entity1=last() |
Contexts: |
Method, event. |
Description: |
Returns the target of the method or event which called or raised of the method or event currently executing; returns Null_Instance if the method or event was called or raised in the main program. |
Errors: |
None. |
Variety: |
function |
Syntax: |
class_entity1=last_class() |
Contexts: |
Method, event. |
Description: |
Returns the class of the target of the method or event which called or raised of the method or event currently executing; returns Null_Class if the method or event was called or raised in the main program. |
Errors: |
None. |
Variety: |
function |
Syntax: |
string1=last_event() |
Contexts: |
All. |
Description: |
Returns the name of the event (in Event_Name#0 format) which called the current method or raised the current event. If there is none, returns NONE. |
Errors: |
None. |
Variety: |
function |
Syntax: |
string1=last_method() |
Contexts: |
All. |
Description: |
Returns the name of the method (in Method_Name#0 format) which called the current method or raised the current event. If there is none, returns NONE. |
Errors: |
None. |
Variety: |
procedure |
Syntax: |
link_handler(entity1,sequence1,object1) |
Contexts: |
All except class definition. |
Description: |
Sets the handlers of an instance or class event (as the case may be) of its target. Sequence1 specifies the event: it may be in the form {"EventName",2} or "EventName#2". Object1 is the routine id of the handler or a sequence of routine id's. Any existing handlers are replaced. |
Note: |
To link new handlers while retaining existing handlers, use CURRENT_HANDLERS in the sequence of routine id's. To remove all specific handlers, use NULL_HANDLER as object1; to revert to using the default handler method as the handler, use DEFAULT_HANDLER. Using link_handler() in an event handler procedure to change the handlers of the event currently being handled is legal but will have no effect until the next time that event is raised. |
Errors: |
Program termination if:
|
Variety: |
type |
Syntax: |
boolean1=live_instance(object1) |
Contexts: |
All. |
Description: |
Returns TRUE if object1 is an instance entity which has not been deleted; returns FALSE if object1 is an instance entity which has been deleted, is a class entity, or is not an entity. |
Errors: |
None. |
Variety: |
function |
Syntax: |
boolean1=live_instance_check(object1,class1) |
Contexts: |
Main program, method, event; no pending exception (except Type_Check_Failure). |
Description: |
If class1 is a normal, final, or abstract class, checks if object1 is a live instance of the class or one of its subclasses; if class1 is an interface, checks if object1 is a live instance whose class implements class1. Throws Type_Check_Failure if the check fails. Returns TRUE. |
Errors: |
None. |