modula-2 input/output procedure using polymorphic and open-ended data type extensions (abstract only)  the modula-2 language does not include special statements or standard procedures for handling input and output as in other languages. by extending modula-2 to include a polymorphic structure, called a variant data type(1), and allowing open-ended structures, it is possible to define procedures that have a function and syntax similar to the i/o statements and procedures of other languages. the variant data type consists of a tag field followed by several options, each containing only one field (unless a structure definition is used). in an assignment operation, the tag field is implicitly adjusted to indicate the data type of the item assigned to the variant typed object. a variable of variant type is considered to be assignment compatible with another value if either both are exactly the same type or if one of the options of the variant type is compatible with the value being assigned to it. for open-ended data structures, the concept of an open array is generalized to allow stack and dynamically allocated open arrays to be defined which allows them to be sized at run-time. the open array concept is extended to procedures allowing them to have open parameter lists which can accept a variable number of arguments when called. these concepts can further be used to eliminate the need for several other standard procedures in the language definition.  the variant type and open parameter lists are used in the definition module given below to define a set of pascal-like input/output procedures. two variant data types are defined, invar for the read procedures and outvar for the write procedures. the options in these data types allow passing of the basic types as well as structured types using the array of word option. this option must be specified last in the list since it is type compatible with all types. the word var in type invar indicates that a field is accessed by reference.  the data type file is a hidden type for use in defining file variables. the parameter lists for the input and output procedures allow the file variable to occur anyplace in the argument list. it can even occur several times or not at all in a single argument list or several different file variables can appear. the read and write procedures can be programmed to not accept a file variable after the first argument. violations cannot be detected at compilation time and would have to be flagged as run-time errors. instead of adding these restrictions, they can be allowed as variations from standard pascal. the result is that a single read or write statement can act like several statements accessing different files.  the file variables input and output are defined for use in accessing a terminal's keyboard and screen respectively, as in pascal. importing these file variables is only necessary if they are to be explicitly used otherwise they can be programmed as the defaults in the implementation module. the implementation module cannot know whether input and output have actually been important by another module or whether they are used as the default file variables so it must initialize them upon program startup.  thomas r. leap