Am 24.12.2016 um 14:21 schrieb Mark Morgan Lloyd:
On 24/12/16 12:30, Bernd Oppolzer wrote:
Regarding ^:
"my" compiler supports different representations for the pointer symbol,
and for other
critical symbols, too:
^ @ -> for the pointer symbol (I use -> most of the time)
[ (. (/ for arrays
{ (* /* for comments ("comment" is supported, too, for historic
reasons)
/* was the form used in the first edition of Wirth's description of
Pascal (might have been before Jensen was there to help out). However
I'd strongly suggest deprecating @ and replacing it with another
digraph, it's used as the address-of operator in Turbo Pascal and its
successors.
I don't like @, too. What you told me about the address-of operator
in Turbo Pascal etc. is a very strong reason to get rid of @; I will
think about it.
I converted all relevant sources (including the compiler itself) to ->,
so this would be ok for me.
I have a function ADDR, which gets the address of every variable (not only
heap elements), automatic and static variables (which I added), too.
ADDR returns an untyped pointer, which is compatible
to every other pointer type, much the same as the constant NIL.
There is a function PTRCAST, which casts every pointer type
to this untyped pointer type. And functions PTRADD, PTRDIFF and so on ...
I borrowed some of the names from PL/1.
Maybe pandora's box, but I need this to do some of the more systems related
work. For example: I rewrote the LE storage management in Pascal and
made it
available to the Stanford Pascal runtime (new functions ALLOC and FREE);
this works perfectly with Hercules and VM; it still has to be tested
with Windows - Linux - OS/2.
I added /* to the list of allowable symbols for comments, because it's
what I knew
from PL/1 and C. Comments have to be terminated by the same symbol which
started them, and: they may be nested (as with FPC).
Kind regards
Bernd
_______________________________________________
fpc-other maillist - fpc-other@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-other