an observation about united modes
chris hermansen
clhermansen@gmail.com
Wed Jun 25 04:24:21 GMT 2025
Hello all,
The other day I was looking at a test routine in the GNU Algol 68
validation suite that declared its parameter list as a united mode. That
is, there was not a prior declaration of
mode foo = union (...)
but rather the parameter was declared to be of mode union (...)
I don't believe I have ever seen this before, and it struck me as unusual.
And, the more I think about it, the more I wonder if united modes truly
exist for any reason beyond facilitating parameter declarations.
The other thing that got me thinking about this is why do we allow operator
overloading but not procedure overloading? Is at least part of the reason
because united mode parameters in procedures take the place of procedure
overloading?
I hope this observation / question doesn't seem overly sophomoric and
pointless. I have long (let's say, since 1976 or so, when I first started
seriously using Algol 68) why it's "ok" to overload operators but "not ok"
to overload procedures. Maybe I just missed the justification for this in
the RR or in the writings of AVW or Lindsey or another Algol 68 luminary.
In any case, in the last few days I have found myself thinking that if I
had procedure overloading I would not need united modes. Is that a foolish
thought?
Thanks in advance for any comments / illumination on the topic.
--
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/20250624/2f401f27/attachment.htm>
More information about the Algol68
mailing list