Pointer comparisons to nil
chris hermansen
clhermansen@gmail.com
Wed Nov 19 01:32:26 GMT 2025
Good evening all;
I have a question that stems from a subject line to a recent post of Jose's:
more mode equivalencing to accompany pointer comparison in a68-moids-misc.cc
One of the things that has "got me" on several occasions is writing a
comparison like
*if* some pointer *is* *nil* *then* ... *fi*
which of course¹ fails because nil is not of the same mode as
some_pointer. Now I don't mind that I can't compare pointers to nil, but I
would really like it if Algol 68 would stop me from doing that; or at least
warn me.
Does anyone have an opinion on this? Will GNU Algol 68 have an opinion on
this?
Thanks in advance!
[1] I think I ran into the back in the day working with Algol68s, but that
was long ago and far away. More recently, I thought at first it was
something to do with Algol 68 Genie but I'm quite positive I spotted the
need to cast nil to the mode of some pointer in McGettrick's textbook from
the 1970.
--
Chris Hermansen · clhermansen "at" gmail "dot" com
C'est ma façon de parler.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://gcc.gnu.org/pipermail/algol68/attachments/20251118/ffa8a6c4/attachment.htm>
More information about the Algol68
mailing list