end_class

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:

  • The class implements an interface, and the class does not define (directly or by inheritance) a public method specified by the interface.
  • The class is a normal or final class which does not override an inherited abstract method.

 

entity

Variety:

type

Syntax:

boolean1=entity(object1)

Contexts:

All.

Description:

Returns TRUE if object1 is an entity, otherwise FALSE.

Errors:

None.

 

error_screen_width

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.

 

event

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:

  • The class is an interface or an exception.
  • Identifer1 duplicates an instance event name or class event name (as the case may be) of the class or of any of its superclasses and integer1 duplicates the number of parameters of that instance or class event.
  • Integer1 is negative.
  • Integer2 is not INSTANCE or CLASS.
  • Object 1 or Object2 is not formatted as above.

 

EXCEPTION

Variety:

constant

Description:

Possible return value of class_type().

 

exception

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:

  • Identifier1 duplicates an existing class, interface, or exception name in the same package.
  • Object1 is not an exception, or any element of object1 (if it is a sequence) is not an exception.
  • Object1 contains duplicate exceptions. (Including an exception and one or more of its superclasses is redundant but legal.)

 

extends

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.

 

FALSE

Variety:

constant

Description:

The integer 0, used as a boolean value.

 

fatal_error

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:

  • The text in string1 prefaced by "FATAL ERROR:".
  • Any currently pending or caught exception.
  • Any currently pending methods.
  • The name of the debug file created or an indication that no debug file was created.

Errors:

None.

 

FINAL

Variety:

constant

Description:

Used in class() or method() to specify a final class or method.

 

get_class

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.

 

get_property

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:

  • Entity1 is a deleted instance, an interface, or an exception.
  • The property to be read is not defined by entity1's class.
  • The currently executing method, event, or main program has inadequate access rights to read the property.

 

identifier

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.

 

implements

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.

 

INSTANCE

Variety:

constant

Description:

Used in property(), method(), or event() to indicate an instance property, method, or event.

 

instance_entity

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.

 

INTERFACE

Variety:

constant

Description:

Possible return value of class_type().

 

interface

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:

  • Identifier1 duplicates an existing class, interface, or exception name in the same package.
  • Object1 itself or any element of object1 (if it is a sequence) is not an interface.
  • Object1 contains duplicate interfaces. (Including an interface and one or more of its superclasses is redundant but legal.)
  • Object2 or object3 contain duplicated methods.

 

is_atom

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.

 

is_boolean

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.

 

is_class

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.

 

is_entity

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.

 

is_identifier

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.

 

is_instance

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.

 

is_integer

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.

 

is_live_instance

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.

 

is_object

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.

 

is_sequence

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.

 

 

last

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.

 

last_class

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.

 

last_event

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.

 

last_method

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.

 

link_handler

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:

  • Entity1 is a deleted instance, an interface, or an exception.
  • The event whose handler is to be linked is not defined by entity1's class.
  • Object1 is not a valid routine id, NULL_HANDLER, DEFAULT_HANDLER, CURRENT_HANDLERS, or a sequence of these values.
  • The currently executing method, event, or main program has inadequate access rights to link the handler.

 

live_instance

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.

 

live_instance_check

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.

 

 

PREV PAGE ----- NEXT PAGE