text/src/TextF.i3


Copyright (C) 1994, Digital Equipment Corp.

INTERFACE TextF;

IMPORT Text;

TYPE CharArray = ARRAY OF CHAR;

REVEAL
  (* Remember, the report says that TEXT is predeclared and <: REFANY;
     just pretend that we have
         TYPE
           TEXT <: REFANY
     in the Text interface. *)

  (* The array contains the characters of the text followed by a '\000' *)

  TEXT = BRANDED Text.Brand REF ARRAY OF CHAR;

PROCEDURE New (n: CARDINAL): TEXT RAISES {};
  (* create a new text capable of holding n characters. Note that its actual
     length as an array is n+1 because of the null termination.
     The characters at positions [0..n-1] are left undefined. The character
     at position n is '\000' *)

END TextF.