Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!motcsd!hpda!hpcuhb!hpcllla!hpclisp!hpclscu!shankar From: shankar@hpclscu.HP.COM (Shankar Unni) Newsgroups: comp.lang.pascal Subject: Re: Re^2: Standard Pascal: Who needs it? Message-ID: <950029@hpclscu.HP.COM> Date: 9 Jul 89 22:47:30 GMT References: <4782@freja.diku.dk> Organization: Hewlett-Packard Calif. Language Lab Lines: 37 > Can anyone tell me why get and put are better than read and write? The I/O model used by Get and Put were very clumsily defined. On a Reset of a file, the first data item is supposed to be ready for reading (via file^). In an interactive environment, with input coming in from a keyboard, this means that the program will hang on a reset, unless the implementation does some fancy footwork with delayed reads and buffer validity flags (usually, "f^" is implemented in these cases as: if buffer contents are not valid then begin read in a record; end; return the contents of the buffer; and Get is implemented as: mark the buffer as having invalid contents. ). Also, we have to take into account multiple Get's, and so on. All in all, pretty ugly. "Read" and "Write" provide a much cleaner interface, including formatting, conversion of numeric to text data and vice versa, and so on. It can also be implemented far more cleanly than get or put. It is pretty clear that the original Pascal was never really designed for any serious programming. ANSI/ISO Pascal (the original one) was scarcely better. The new one seems to be a sort of smorgasbord of everyone's favorite features, but punts on many important items. Sheesh, it doesn't even have any standard method of doing conditional compilation, or including files in a compilation unit. Back to "cpp" :-(. ---- Shankar ("ex-Pascal compiler drudge") Unni.