GNU Algol 68 Coding Guidelines - V3 possible inconsistencies and errata?
chris hermansen
clhermansen@gmail.com
Wed Jan 14 20:43:45 GMT 2026
Good afternoon everyone,
I may be making a bad decision here and if so PLEASE feel free to chastise
me.
I see the odd minor thing in Jose's excellent Coding Guidelines and I have
chosen to report them here rather than inserting a single line in the midst
of hundreds of lines of quote text.
1. missing? I see declarations such as "[]int" but I don't see a rule about
spacing in row declarations - or is this covered by "Spaces in bounds"?
2. consistency? I read "But make sure to always put a space between `union'
or `struct' and
the open parenthesis that follows in declarers" - are these the only times
spaces are allowed in declarers? Otherwise I'm confused as to why we are
requiring "struct (int a,real b) foo" but "proc(int,real)void" - in a
parameter pack with a struct do we code it as "struct(int a,real b)foo"?
3. erratum? I see "op(intint)int handler;" but think it should be
"op(int,int)int handler;"
4. erratum? I see "json_foreach_elem(a, (ref JSON_Val v) void: len +:= 1)"
but I feel that this should maybe be "json_foreach_elem(a, ref JSON_Val v)
void: (len +:= 1)" or maybe something else entirely
5. wrong place? There is a paragraph in "Spaces in indexers and trimmers"
that indicates preference for [ and ] rather than ( and ); I think this
paragraph should have its own section, or maybe be combined with a section
on preferred orthography.
6. suggestion for improvement? This sentence:
In little local auxiliary routines, do not add arguments just to pass a
> value thas is in the environment, unless the declaration of the later is
> very far away from the routine text: make the routine access the value
> itself.
Here "thas" should be "that" and "later" should be "latter".
But my main point is "very far away" - let me describe a hypothetical
situation:
- 17 ref int, ref real and ref string are declared
- "further along" a "little local auxiliary routine" is declared that reads
9 of these values and alters 3 more
If this is really necessary, in my view the auxiliary routine should be
declared right next to the 17 ref int etc values so that it is clear to the
maintainer that the purpose of the auxiliary routine is to manipulate these
values thoroughly, rather than declare the auxiliary routine near where it
is called.
So I would advocate for the paragraph to be more along the lines of:
In little local auxiliary routines, do not add arguments just to pass a
value that is in the environment; rather, place the declaration of the
auxiliary routine near the declarations of the values it accesses. If this
is not possible, then it may be wise to judiciously pass those non-nearby
values as arguments in order that the programmer be aware that non-nearby
values are being accessed or possibly altered.
--
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/20260114/6c9eed47/attachment.htm>
More information about the Algol68
mailing list