%% Copyright (c) 1995,1996 by the University of Pennsylvania %% %% For information about the distributaion, copying, and modification %% %% of this software, please read the file COPYING located in the root %% %% directory of this distribnutaion. If you did not receive the file %% %% COPYING write to Philip Wickline at the address below. %% %% This program is distributed in the hope that it will be useful but %% %% WITHOUT ANY WARRANTY; without even the implied warranty of %% %% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the file %% %% COPYING for more details. %% %% For information about the structure of the Terzo lambdaProlog %% %% implementation, see the file src/README in this distribution. Please %% %% address any questions about this code or the Terzo lambdaProlog %% %% implementation to Philip Wickline at . %% %% Author: %% %% Philip Wickline %% module String. import Exception, List. type index_out_of_bounds, not_chr exn. % String concatenation. type ^ string -> string -> string. infixl ^ 6. % Returns the length of its string argument. "" has length 0. type size string -> int. % chr i - Returns as a signleton string the ascii character % whose value is i. Raises not_chr if i > 255 type chr int -> string. % ord s - Returns the ascii value of the first character in s. % Raises index_out_of_bounds if s is "". type ord string -> int. % substring s i j - returns the string starting at position i % (zero indexed) in the string, and ends at position i + j. % Raises index_out_of_bounds if i < 0, or i + j > size s. type substring string -> int -> int -> string. % lexicographic predicates on strings: type s>, s<, s>=, s=< string -> string -> o. infix s>, s<, s>=, s=< 4.