[comp.lang.pascal] Re^2: Standard Pascal: Who needs it?

leonard@bucket.UUCP (Leonard Erickson) (07/03/89)

cavrak@uvm-gen.UUCP (Steve Cavrak,113 Waterman,6561483,) writes:

>The other day I watched a friend port about 400 lines from Turbo Pascal on
>a PC to Lightspeed on a Mac ... 

>Besides the horror of discovering that the Mac has a problem with the
>line-feed character, and that the European quote caused Lightspeed to
>hang, Wes discovered the long list of "features" that "does not compute"
>(pre initialized "variables" for instance; something strange about the
>undocumented "byte" type, etc.).  

>The conclusion was that this is "Fortran" all over again, and that
>programmers have to adhere to "standards" while the manufacturers lure
>them away with convenient features.  

Well, at least Borland has a section in the manual that spells out the ways
in which Turbo Pascal isn't ANSI compliant. Both extensions and ommissions
are listed.

BTW, have you noticed that Microsft is advertising QuickPascal as being
compatible with Turbo Pascal? I guess that tells us what the de facto
standard is for IBMs and clones...  :-)

-- 
Leonard Erickson		...!tektronix!reed!percival!bucket!leonard
CIS: [70465,203]
"I'm all in favor of keeping dangerous weapons out of the hands of fools.
Let's start with typewriters." -- Solomon Short

shankar@hpclscu.HP.COM (Shankar Unni) (07/10/89)

> 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.