Appendix A Built-In Functions for ADL
Effects: prints a human-readable representation of argument to standard output.
Returns: argument.
Effects: reads a string up to white-space from standard input.
Returns: the string that was read.
die (string message)
Effects: prints the contents of message to standard error, then exits with exit code
Returns: die does not return
Returns: A time value whose hours, minutes, seconds, and milliseconds are set to the current local time.Platforms that cannot provide a given level of granularity should return 0 for that part of the time. For instance, if a machine cannot provide milliseconds, localTime may return the current time with milliseconds set to 0.
Note: AthenaMuse2 relies on the system's idea of the current local time for this function. If you are not happy with the value returned, please check that the time is set properly on your machine.
Returns: A list containing four integer elements:
Requires: a boolean, a string containing a "TRUE" or "FALSE" (any capitalization), an integer, a real, or a time.
Effects:. ERtype error if the type cannot reasonably be converted to a boolean.
Returns: a boolean representation of the value in source.
Requires: an integer, a string containing an integer, a real that is smaller than the maximum size of an integer, a boolean, or a time (converts to number of milliseconds).
Effects: ERsemantic error if the value in source is too large for an integer.ERtype error if the value in source cannot reasonably be converted to an integer.
Returns: an integer representation of the value in source.
Requires: An interval, a string containing an interval constant, or a list of the format: {{boolean,integer/real},{boolean,integer/real}}.
Effects: ERtype error if the value in source cannot reasonably be converted to an interval.
Returns: the interval representation of the value in source.
Requires: A time, an integer (milliseconds), a real (rounded to integer milliseconds), a string, or a list with one to four integer elements (representing the least significant parts of the time, i.e. 2 elements implies seconds and milliseconds).
Effects: ERtype error if the value in source cannot reasonably be converted to a time.
Returns: the time representation of the value in source.
Requires: A list, a string containing a list with constant elements, or an interval.
Effects: ERtype if the value in source cannot reasonably be converted to a list.
Returns: the list representation of the value in source.
Requires: A real, an integer, a boolean, or a string representing a constant real in the same format as that recognized by the parser
Effects: ERtype if the value in source cannot reasonably be converted to a real.
Returns: A real number representing the value in source.
Returns: A string representation of source. If source is a handle this call produces a fatal error.
Returns: The vtype of the argument value.
canConvert(string source, vtype conversionType)
Returns: TRUE if the source can be converted to conversionType, FALSE if not. Put another way, canConvert returns TRUE if the appropriate conversion built-in (toBoolean, toInteger, etc.) for conversionType succeeds when given source as an argument.
Returns: If source is a list, the item at index is returned. If source is a string, a one character string containing the character at index is returned. The index is counted from 1, not 0.
Notes: If index exceeds the length of source, an ERsemantic error is generated. This behavior may change.
Returns: The first element of the list if source is a list or the first character of it is a string. If source is empty, an empty sequence of the same type as source (list or string) is returned.
Returns: A sequence of the same type (list or string) containing all but the first element in source. If the sequence is empty or only contains a single element or character, the returned sequence will be empty.
Returns: TRUE if test contains no items (list) or characters (string), FALSE otherwise.
Returns: The number of elements (list) or characters (string) in source.
extract(sequence source,integer start,integer length)
Returns: A sequence containing the elements of source with indices from start to start+length-1. Sequence indices start at 1, not 0.
Notes: If an attempt is made to extract beyond the end of a sequence, a shorter sequence will be returned containing only those items from start to the end of the sequence.
find(any key, sequence source)
Returns: If source and key are strings, returns index of first character of first occurrence of key in source, or 0 if key is not found in source (since indices in sequences start with 1). If source is a string, but key is not, an ERsemantic error is generated. If source is a list, returns index of first member of source found to be equal to key, or 0 if no match is found.
Notes: lists are not searched recursively, only top level members are compared, and no type conversion is performed, i.e. 1.0 != 1.
Returns: the list of substrings from source that remains after every occurrence of delim is deleted from it. If two instances of delim occur immediately adjacent to each other or if source starts or ends with an occurrence of delim, then an empty string is inserted into the list at the appropriate position.
Returns: TRUE if all the characters in the source string are one of [A-Z, a-z]
Returns: a string identical to source except that all lowercase alphabetic characters will have been changed to uppercase.
Example: toUpper("teSt sTriNG!") returns "TEST STRING!"
Returns: a string identical to source except that all uppercase alphabetic characters will have been changed to lowercase.
By default, DOMAIN and SING errors are treated as fatal, and all others are ignored. The developer may change this behavior by sending a 'SetFatalErrors message to theApp. Please see _ for further information.
Returns: A random number in range. If both limits of range are integers, an integer will be returned; otherwise a real will be returned.
Returns: The nonnegative square root of val expressed as a real. A DOMAIN error occurs if val is negative.
Returns: base raised to the power exp expressed as a real. exp may be a real if base is nonnegative. A DOMAIN error occurs if base is negative and exp is not an integral value, and it may occur when base is 0 and exp is less than or equal to 0. This built-in may also generate OVERFLOW or UNDERFLOW errors.
Returns: The exponential function of val, , expressed as a real. An OVERFLOW or UNDERFLOW error may occur.
Returns: The natural logarithm of val expressed as a real. A DOMAIN error will occur if val<0.0 and a SING error if val==0.
Returns: The base 10 logarithm of val expressed as a real. A DOMAIN error will occur if val<0.0 and a SING error if val==0.
Returns: The cosine of val (interpreted in radians) expressed as a real.
Returns: The sine of val (interpreted in radians) expressed as a real.
Returns: The tangent of val (interpreted in radians) expressed as a real
Returns: The principal value of the arc cosine of val (interpreted in radians) expressed as a real in the range . A DOMAIN error will occur if val does not fall with in the range [-1,1].
Returns: The principal value of the arc sine of val (interpreted in radians) expressed as a real in the range . A DOMAIN error will occur if val does not fall with in the range [-1, 1].
Returns: The principal value of the arc tangent of val (interpreted in radians) expressed as a real in the range .
Returns: The principal value of the arc tangent of expressed as a real in the range . A DOMAIN occur error will occur if both y and x are 0.
Returns: The hyperbolic cosine of val expressed as a real. An OVERFLOW error may occur.
Returns: The hyperbolic sine of val expressed as a real. An OVERFLOW error may occur.
Returns: The hyperbolic tangent of val expressed as a real.
Returns: The integer part of val expressed as a real. The returned value always has the same sign as val.
Returns: The fraction part of val expressed as a real. The returned value always has the same sign as val.
Returns: The smallest integral value not less than val expressed as a real.
Returns: The absolute value of val expressed as a real.
Returns: The largest integral value not larger than val expressed as a real.
Returns: The floating-point (real) remainder of . That is, if , then , such that , r has the same sign as x, the magnitude or r is less than that of y. A DOMAIN error may occur if y==0.
Returns: The constant e at the significance of a real.
Returns: The constant pi at the significance of a real.
Returns: TRUE if the handle is non-NULL and points to a valid object or variable, otherwise FALSE.
Returns: TRUE if hObject points to an object (as opposed to a variable of base, compound or complex type), hClass points to a wrapped or ADL class, and hObject points to an instance of the class pointed to by hClass or to a class derived from it.
Notes: Pointers to classes are generally derived from expressions using the operators theClass or classOf (see Section 3.22, "Metaclass Operations" page 43).
Returns: The string name of the class pointed to by the handle hClass or the null string if the class is anonymous.
Notes: Pointers to classes are generally derived from expressions using the operators theClass or classOf (see Section 3.22, "Metaclass Operations" page 43).
isDirectBaseOf( handle hSuspectedBaseClass, handle hKidClass )
Returns: boolean
Effects: If hSuspectBaseClass is a pointer to a direct base class of the class pointed to by hKidClass, returns TRUE, else FALSE.
Warning: It is a fatal error for either argument to be NULL or to not point to a class.
Returns: A string containing the name of the user executing AthenaMuse2.
Returns: If Domain Name Service is enabled on the system, the fully qualified hostname is returned. Otherwise, the host table entry for the machine is returned. This may or may not be a fully qualified hostname depending on the format of the host table for the system.
Generated with Harlequin WebMaker