[Image] [Image] [Image] [Image]
Next: Zdatr 2.0 builtin library
Up: Zdatr Version 2.0 Reference
Previous: Log file
The DATR Standard Library RFC 2.0 should be consulted for descriptions and examples
of the library functions.
In order to inherit from a library node, it must be defined as specified
in the RFC 2.0, for example:
#uses Calc Permute Random Sort .
The library functions can be assigned to four main classes:
- Input-Output and Inter Process Control
- Calculator
- String
- Boolean
- Meta-object
A number of features of DATR implementations have not been standardised,
and the RFC 2.0 does not take a position on the following issues, for which
implmentation specific decisions have therefore been taken:
- Treatment of non-functional (non-DATR) theories with LHS path duplicates and implementations differ wildly in their solutions. A strict solution would be to reject the theory, a lax solution would be to take an arbitrary member of such a set. In Zdatr 2.0 the outcome is defined as unpredictable.
- The implementation of standard library functions can conceivably be in the form of builtins or, as is common practice with many other languages, as standard library files implemented in DATR. In Zdatr 2.0 the following division of labour between builtins and DATR defined functions is defined:[Image]
- Builtins implement RFC functions which cannot be defined in current DATR semantics (or for which a definition has not yet been worked out).
- Other RFC functions are implemented in DATR and contained in standard library files.
- An exception is the Idem (Copy) function, which is implemented as a builtin for efficiency.
- The external library functions, which are implemented in DATR, use Zdatr 2.0 specific naming conventions in order to avoid name space clashes. These conventions must be avoided in user theories.
- Character level tokenisation conventions based on common implementation practice had to be defined for Zdatr 2.0:
- DATR reserved characters outside quoted atoms are also atom and node delimiters.
- Quoted atoms may contain any characters, including DATR reserved characters,
- the # prefix for directives may optionally be followed by white space.
- Non-printable characters are represented by the UNIX standard escape sequences detailed in the theory syntax specification (cf. section 3).
The Zdatr 2.0 library functions are RFC compliant, but introduce a few (ignorable)
additional properties for convenience in developing large and possibly hybrid
theories in practical project contexts.
Builtins are required by RFC to be declared by the #uses
directive. Optionally, builtins may be renamed.
[Image] [Image] [Image] [Image]
Next: Zdatr 2.0 builtin library
Up: Zdatr Version 2.0 Reference
Previous: Log file
© Dafydd Gibbon
Sun Sep 13 17:17:46 MET DST 1998