Path: utzoo!mnetor!uunet!husc6!bbn!rochester!ur-tut!sunybcs!boulder!hao!ames!umd5!brl-adm!adm!jipping@frodo.cs.hope.EDU From: jipping@frodo.cs.hope.EDU (Mike Jipping) Newsgroups: comp.lang.pascal Subject: Re: Pascal Enumerated I/O Message-ID: <11903@brl-adm.ARPA> Date: 19 Feb 88 06:12:40 GMT Sender: news@brl-adm.ARPA Lines: 30 > I'm trying to find out if any version of Pascal running on any machine > supports I/O on enumerated data types. Example: > ... > I think I've heard of versions of Pascal that allow I/O on enumerated > types, but I can't for the life of me remember any specifics. It seems to me that doing I/O on enumerated types goes against the grain of the concept. If you take a strict view of data typing, what does a compiler expect from input or print to output? Certainly not a sequence of characters -- for that would be a string (i.e., array of char), NOT an enumerated type. And certainly not a number (perhaps indicating the ordinal value...) for the same typing reasons. Perhaps this is why it isn't implemented. And why enum I/O is not defined in the Pascal standards. Maybe what is necessary is a "string-to-enum-type" function, taking a string and jumping on it to (somehow) give the enum type. However, allowing this type conversion string -> enum will most likely have to access the implementation of a specific type representation for a specific compiler. At best, not a portable solution... > Danny Sharpe, Ga Tech Box 34832, Atlanta, GA, 30332 > Internet: dts@pyr.gatech.edu > uucp: ...!{decvax,hplabs,ihnp4,linus,rutgers,seismo}!gatech!gitpyr!dts Mike Jipping Dept. of Computer Science Hope College jipping@cs.hope.edu