Bit shift operators, untyped pointers, Borland Pascal

Wed, 24 Jul 1996 17:08:15 +0200 (MET DST)


Berend de Boer wrote:
> bit-shift operators have to depend upon memory
> layout and byte ordering.

That's not true.  The bit-shift oparations are mathematically defined on 
the set of integer numbers and are independend from the representation of
the number in memory.  $900 shr 1 = $480  (or: 16#900 shr 1 = 16#480 :-)
holds on any machine, independendly of the question whether the numbers are
stored internally as 00 09 and 80 04 or as 09 00 and 04 80.

> I can quite agree with you. But don't forget: there are millions, literally
> millions of code written in some form of Standard Pascal out there in the world.
> For such people an alternative in the form of GNU Pascal could really be
> interesting.

I would guess that even much more code has been written for Borland Pascal,
and for those programmers GNU Pascal could be interesting too.  However the
best thing is to support both.

> I *have* to use much more untyped pointers in Borland Pascal (in obtaining 
> addresses from procedures, strings, etc.) than would be necessary.

With Borland Pascal, you can have procedural parameters, Pointers to strings, 
etc..  The construct @myString is a pointer to a string, no untyped pointer, 
when you enable the "typed @ operator" option.  You don't need to use untyped
pointers in Borland Pascal, except for real low-level programming.

    Peter


Peter Gerwinski (peter@agnes.dida.physik.uni-essen.de)

HTML conversion by Lluís de Yzaguirre i Maura
Institut de Lingüística Aplicada - Universitat "Pompeu Fabra"
e-mail: de_yza@upf.es