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 pre-defines several external procedures. All of the OADL
predefined external procedures are found in the
oadl namespace.
str2var(str)
NameCheck
exception will be thrown.wait(millis)
srandom() srandom(opt-seed)
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()
Float from 0.0 to
1.0objname(obj)
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)
nil
if the name cannot be determined. Note that publics exist in a
separate namespace from other program objects.findobj(str)
Class,
Object, Proc, or other
global named constant) whose name is str, or
nil if no object was found.findpub(str)
Public whose name is
str or nil if it is not foundNon-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:
term.std and namespace
math.sys.glut.gl1.gl2.o3d.io.adv (libadv) and
namespace stdadv (stdadv)