ALPHABETICAL LISTING OF GLOBAL ROUTINES, VARIABLES, AND CONSTANTS

 

The syntax convention for routines is to show the return value (for functions and types) and the parameters as type names with digits to distinguish them: object1, integer2, entity3, etc. All errors are listed except type clashes and illegal program contexts. Context indicates the legal program contexts for the routine.

 

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

 

ABSTRACT

Variety:

constant

Description:

Used in class() or method() to specify an abstract class or method.

 

ABSTRACT_METHOD

Variety:

constant

Description:

Used in method() in place of a routine id for abstract methods.

 

 

an_instance

Variety:

function

Syntax:

sequence1=an_instance(object1)

Contexts:

All.

Description:

If object1 is an entity, returns a modified value indicating a hypothetical instance of the class indicated by object1, if object1's class is normal or final; otherwise returns Null_Instance. Used as the first parameter for can_get(), can_set(), can_call(), can_link(), and can_raise() and their _list() equivalents.

Note:

Do not use an_instance() for any other purpose; while it is not an error to use an_instance() in any other way, only the functions listed above will interpret it correctly.

Errors:

None.

 

call_method

Variety:

function

Syntax:

object1=call_method (entity1,identifier1,sequence1) OR
object1=call_method(super(),identifier1,sequence1) OR
object1=call_method(super_class(),identifier1,sequence1)

Contexts:

Main program, method, event; no pending exception.

Description:

Calls the appropriate method of entity1 's class with entity1 as its target. If entity1 is an instance, an instance method is called; if a class, class method is called. Identifier1 gives the name of the method and the number of parameters is the length of sequence1. Sequence1 is passed to the method as its parameters (if any). Returns the return value of the method. See super() and super_class() for the second and third syntax.

Note:

Be careful of one parameter methods when passing a sequence or entity. For example: call_method(x,"DoThis","ABC") does not pass ABC to x's DoThis#1 method--it passes 'a', 'b', and 'c' to x's DoThis#3 method. The correct syntax is call_method(x,"DoThis",{"ABC"}). Similarly, if y is an entity, then call_method(x,"DoThat",y) will split y into the components of its handle and pass them to x's DoThat#3 method. Correct syntax to pass y to x's DoThat#1 method is call_method(x,"DoThat",{y}).

Errors:

Program termination if:

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

 

can_call

Variety:

function

Syntax:

boolean1=can_call(entity1,identifier1,sequence1)

Contexts:

All.

Description:

Returns FALSE if call_method() with entity1, identifier1, and sequence1 as parameters would cause program termination, otherwise returns TRUE.

Errors:

None.

 

can_call_list

Variety:

function

Syntax:

sequence1=can_call_list(entity1)

Contexts:

All.

Description:

Repeatedly calls can_call() for all instance or class methods (as the case may be) for entity1. Returns a sequence of method names for which can_call() returns TRUE.

Errors:

None.

 

can_get

Variety:

function

Syntax:

boolean1=can_get(entity1,identifier1)

Contexts:

All.

Description:

Returns FALSE if get_property() with entity1 and identifier1 as parameters would cause program termination, otherwise returns TRUE.

Errors:

None.

 

can_get_list

Variety:

function

Syntax:

sequence1=can_get_list(entity1)

Contexts:

All.

Description:

Repeatedly calls can_get() for all instance or class properties (as the case may be) for entity1. Returns a sequence of property names for which can_get() returns TRUE.

Errors:

None.

 

can_link

Variety:

function

Syntax:

boolean1=can_link(entity1,sequence1)

Contexts:

All.

Description:

Returns FALSE if link_handler() with entity1 and sequence1 as its first two parameters would cause program termination, otherwise returns TRUE.

Note:

If can_raise returns TRUE, set_handler() with the corresponding pararameters and an appropriate routine id would be successful.

Errors:

None.

 

can_link_list

Variety:

function

Syntax:

sequence1=can_link_list(entity1)

Contexts:

All.

Description:

Repeatedly calls can_link() for all instance or class events (as the case may be) for entity1. Returns a sequence of event names for which can_link() returns TRUE.

Errors:

None.

 

 

can_raise

Variety:

function

Syntax:

boolean1=can_raise(entity1,identifier1,sequence1)

Contexts:

All.

Description:

Returns FALSE if raise_event() with entity1, identifier1, and sequence1 as parameters would cause program termination, otherwise returns TRUE.

Note:

If can_raise returns TRUE, set_handler() with the corresponding pararameters and an appropriate routine id would be successful.

Errors:

None.

 

can_raise_list

Variety:

function

Syntax:

sequence1=can_raise_list(entity1)

Contexts:

All.

Description:

Repeatedly calls can_raise() for all instance or class events (as the case may be) for entity1. Returns a sequence of event names for which can_raise() returns TRUE.

Errors:

None.

 

can_set

Variety:

function

Syntax:

boolean1=can_set(entity1,identifier1)

Contexts:

All.

Description:

Returns FALSE if set_property() with entity1 and identifier1 as its first two parameters would cause program termination, otherwise returns TRUE.

Errors:

None.

 

can_set_list

Variety:

function

Syntax:

sequence1=can_set_list(entity1)

Contexts:

All.

Description:

Repeatedly calls can_set() for all instance or class properties (as the case may be) for entity1. Returns a sequence of property names for which can_set() returns TRUE.

Errors:

None.

 

cancel_event

Variety:

procedure

Syntax:

cancel_event()

Contexts:

Method or event.

Description:

Cancels any further event handling for the current event.

Errors:

None.

 

catch

Variety:

function

Syntax:

boolean1=catch(class_entity1)

Contexts:

Main program, method, event.

Description:

If class_entity1 is the class of the pending exception or of a superclass of the pending exception, returns TRUE and clears the pending exception; otherwise returns FALSE. Returns FALSE if no exception is pending.

Note:

Since all exceptions are direct or indirect subclasses of Exception,

 

catch(Exception) 

will catch any exception.

Errors:

Program termination if Class_Entity1 is not an exception.

 

caught

Variety:

function

Syntax:

class_entity1=caught()

Contexts:

Main program, method, event.

Description:

Returns the exact exception processed by catch(). Returns Null_Instance if no exception has been processed since the last execution of any Diamond routine which is not allowed with a pending exception.

 

CLASS

Variety:

constant

Description:

Used in property(), method(), or event() to specify a class property, method, or event.

 

class

Variety:

function

Syntax:

class_entity1=class(identifier1,integer1,object1,object2)

Contexts:

Main program; no pending exception. Class definition if an inner class.

Description:

Begins the definition of a class with the name identifier1. Integer1 is the class type (NORMAL, FINAL, or ABSTRACT, INTERFACE, or EXCEPTION). Object1 is a class entity or a sequence of class entities (which may be empty), designating the superclass or superclasses of the new class. For normal, abstract, and final classes, only one superclass is allowed, which must be a normal or abstract class. If object1 is NONE, then Entity will be the superclass. For interfaces, multiple superclasses are allowed, all of which must be interfaces. If object1 is NONE, there will be no superclasses. For exceptions, multiple superclasses are allowed, all of which must be exceptions. If object1 is NONE, Exception will be the superclass. Object2 is a class entity or a sequence class entities (which may be empty), designating the interface or interfaces to be implemented by the class. If Object2 is NONE, no interfaces are implemented. Object 2 must be NONE is integer1 is INTERFACE or EXCEPTION. Returns the new class' handle.

Note:

It is strongly recommended to assign class_entity1 to a global constant. It is preferable to use interface() to define interfaces and exception() to define exceptions.

Errors:

Program termination if:

  • Identifier1 duplicates an existing class name in the same package.
  • Integer1 is not NORMAL, FINAL, ABSTRACT, INTERFACE, or EXCEPTION.
  • Object1 does not meet the requirements above.
  • Object1 designates a normal superclass and integer1 is ABSTRACT.
  • Object1 is INTERFACE or EXCEPTION for an inner class.
  • Object2 is not an interface or (if object2 is a sequence) any element of object2 is not an interface.
  • Object2 contains duplicate interfaces.
  • Object2 is not NONE if integer1 is INTERFACE or EXCEPTION.

 

class_data

Variety:

function

Syntax:

sequence1=class_data(object1)

Contexts:

All.

Description:

If object1 is not an entity, returns an empty sequence, Otherwise, returns a ten-element sequence with all available data about the entity's class:

  1. The class' name in the format Class_Name (Package Name).
  2. An integer representing the class' type: see class_type().
  3. A sequence of the class' superclasses, if any.
  4. A sequence of the interfaces implemented by the class, if any.
  5. A sequence of the class's instance properties. Each element is a 7-element sequence:
    1. The property's name.
    2. The property's source class--the class which defined this property.
    3. The property's read access: PUBLIC, PROTECTED, or PRIVATE.
    4. A boolean indicating whether this property has a getter.
    5. The property's write access.
    6. A boolean indicating whether this property has a setter.
    7. PERSISTENT or TRANSIENT.
  6. A sequence of the class' class properties, formatted as in #5.
  7. A sequence of the class' instance methods. Each element is a 4-element sequence:
    1. The method's name in the format method_name#0.
    2. The method's source class.
    3. The method's type: NORMAL, FINAL, or ABSTRACT.
    4. The method's access.
  8. A sequence of the class' class methods, formatted as in #7
  9. A sequence of the class' instance events. Each element is a 4-element sequence:
    1. The event's name in the format event_name#0.
    2. The event's source class.
    3. The event's link access.
    4. A boolean indicating whether this event has a linker.
    5. The event's raise access.
    6. A boolean indicating whether this event has a raiser.
  10. A sequence of the class' class events, formatted as in #9.

Errors:

None.

 

class_entity

Variety:

type

Syntax:

boolean1=class_entity(object1)

Contexts:

All.

Description:

Returns TRUE if object1 is a class entity; returns FALSE if object1 is an instance entity or is not an entity..

Errors:

None.

 

class_name

Variety:

function

Syntax:

string1=class_name(object1)

Contexts:

All.

Description:

If object1 is an entity, returns object1's class name in the format "class_name (package_name)". If object1 is not an entity, returns NONE.

Errors:

None.

 

class_type

Variety:

function

Syntax:

integer1=class_type(object1)

Contexts:

All.

Description:

If object1 is an entity, returns object1's class type (NORMAL, FINAL, ABSTRACT, INTERFACE, EXCEPTION, NULL_CLASS). If object1 is not an entity, returns NIL.

Errors:

None.

 

 

CURRENT_HANDLERS

Variety:

constant

Description:

Used in the sequence of handler routine ids for link_handler() to specify the currently linked handlers.

 

 

CURRENT_VERSION

Variety:

constant

Description:

The current Diamond version in sequence form: {4,0,0}

 

 

debug_file

Variety:

procedure

Syntax:

debug_file()

Contexts:

All.

Description:

Creates a debug file as specified by debug_file_option(), listing:

  • The error message if called from fatal_error().
  • Any currently pending or caught exception.
  • Any currently pending methods and events.
  • A detailed listing of each class in the program.

Note:

Called by fatal_error().

Errors:

Program termination if the debug file cannot be opened.

 

debug_file_option

Variety:

procedure

Syntax:

debug_file_option(object1)

Contexts:

All.

Description:

If object1 is:

  • DFO_NONE, then debug_file() will not create a debug file.
  • DFO_WRITE, then debug_file() will create a debug file named diamond.err in the current directory, overwriting any preexisting file. (This is the default).
  • DFO_APPEND, then debug_file() will create a debug file named diamond.err in the current directory, appending to any preexisting file.
  • DFO_NEW, the debug_file() will create a debug file in the current directory. If diamond.err does not exist, this will be the name of the debug file. If diamond.err exists, the new debug file will be named diamd001.err; if this exists, the new file will be named diamd002.err, etc.
  • any other value, then the current setting is unchanged.

Errors:

None.

 

DEFAULT_HANDLER

Variety:

constant

Description:

Used in place of a routine id in link_handler() to specify using the default handler as the specific handler for the target.

 

 

deleted_instance

Variety:

type

Syntax:

boolean1=deleted_instance(object1)

Contexts:

All.

Description:

Returns TRUE if object1 is an instance entity which has been deleted; returns FALSE if object1 is an instance entity which has not been deleted, is a class entity, or is not an entity..

Errors:

None.

 

DFO_APPEND

Variety:

constant

Description:

Used as a parameter for debug_file_option(), specifies that debug_file() will create a debug file named diamond.err in the current directory, appending to any preexisting file.

 

DFO_NEW

Variety:

constant

Description:

Used as a parameter for debug_file_option(), specifies that debug_file() will create a debug file in the current directory. If diamond.err does not exist, this will be the name of the debug file. If diamond.err exists, the new debug file will be named diamd001.err; if this exists, the new file will be named diamd002.err, etc.

 

DFO_NONE

Variety:

constant

Description:

Used as a parameter for debug_file_option(), specifies that debug_file() will not create a debug file.

 

DFO_WRITE

Variety:

constant

Description:

Used as a parameter for debug_file_option(), specifies that debug_file() will create a debug file named diamond.err in the current directory, overwriting any preexisting file.

 

do_type_check

Variety:

function

Syntax:

boolean1=do_type_check(object1,integer1)

Contexts:

Main program, method, event; no pending exception (except Type_Check_Failure).

Description:

Integer1 is the routine id of a type. Uses call_func() to test whether object1 is of that type. If it is not, throws Type_Check_Failure. Returns TRUE.

Errors:

None.

 

PREV PAGE ----- NEXT PAGE