External Procedures

External procedures are those which are implemented externally to the OADL machine. They may be called by OADL programs, but they are not an intrinsic part of the OADL machine.

OADL Predefined External Procedures

OADL pre-defines several external procedures. All of the OADL predefined external procedures are found in the oadl namespace.

str2var(str)
Convert a string value to an OADL value. The str can be numeric, one of the predefined OADL constants, or one of the user-defined named constants, procedures, classes, objects, etc. If str is not recognized, a NameCheck exception will be thrown.
wait(millis)
Causes a delay of millis milliseconds to occur. Useful when doing lots of output.
srandom()
srandom(opt-seed)
If the Int opt-seed is specified, sets the random number seed to opt-seed. If not, sets the random number seed to a number based on the current system clock.
random()
Returns a pseudo-random Float from 0.0 to 1.0
objname(obj)
Returns the name of the given obj as provided by the programmer in the original source file, or nil if the name cannot be determined. Note that obj need not be an Object; it can be a Proc, a named constant String, etc. Note, however, that if two named constants have the same value in the source program, objname() will return indeterminate results. Only global symbols will be able to have their objname() determined.
pubname(pub)
Returns the name of the given pub as provided by the programmer in the original source file, or nil if the name cannot be determined. Note that publics exist in a separate namespace from other program objects.
findobj(str)
Returns the global static value (a Class, Object, Proc, or other global named constant) whose name is str, or nil if no object was found.
findpub(str)
Returns the Public whose name is str or nil if it is not found

External Libraries

Non-predefined external functions are linked with the OADL program with the "using extern" statement:

using extern "libfoo"; // Implements foo::bar
extern foo::bar;
proc main()
{
    foo::bar();
}

See the chapter on OADL Implementation Notes for more information on implementing external procedure libraries.

Several standard external libraries are provided with OADL. These include:

libterm
Library for terminal I/O including cursor addressing, etc. Implements namespace term.
libstd
Provides similar functionality to libc / libm from C. Implements namespace std and namespace math.
libsys
Provides access to system-dependent functions such as file system operations and time queries. Implements namespace sys.
libglut
Library for OpenGL utilities, using glut. Implements namespace glut.
libgl1
Library that provides OpenGL ES 1.1 functionality, including emulation on full desktop OpenGL. Implements namespace gl1.
libgl2
Library that provides OpenGL ES 2.0 functionality, including emulation on full desktop OpenGL. Implements namespace gl2.
libo3d
Library that provides 3D graphics functionality. Implements namespace o3d.
libio
Library that provides functionality similar to C/C++ stdio. Implements namespace io.
libadv
stdadv
Libraries that assist the implementation of text adventure games. Implements namespace adv (libadv) and namespace stdadv (stdadv)

Back to Intrinsic Procedures and Methods

Continue to Input / Output

Return to Introduction