From: Jose E. Marchesi Date: Wed, 11 Feb 2026 22:03:44 +0000 (+0100) Subject: a68: add coding guideline on enquiry clauses X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f7645b25985b86918974390dd5d58382ad628b8f;p=thirdparty%2Fgcc.git a68: add coding guideline on enquiry clauses Signed-off-by: Jose E. Marchesi gcc/algol68/ChangeLog * ga68-coding-guidelines.texi (Enquiry clauses): New section. --- diff --git a/gcc/algol68/ga68-coding-guidelines.texi b/gcc/algol68/ga68-coding-guidelines.texi index ee68d7ae853..ef0bcfc4acc 100644 --- a/gcc/algol68/ga68-coding-guidelines.texi +++ b/gcc/algol68/ga68-coding-guidelines.texi @@ -773,6 +773,7 @@ facilities of the language. @menu * Writing routines:: +* Enquiry clauses:: * Nihils:: @end menu @@ -813,6 +814,31 @@ 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. +@node Enquiry clauses +@section Enquiry clauses + +@dfn{Enquiry clauses} are not just ``boolean expressions'' with a +fancy name. They can be thought as a sort of specialized serial +clauses, and as such they can contain any number of declarations and +units while being required to always yield a value of mode +@code{bool}. + +Avoid polluting the lexical environment with declarations that are +intended to be used exclusively within conditional and loop clauses: +use a declaration in the enquiry-clause of the clause instead. This +also makes it easier to later refactor code. + +Examples: + +@example +@{ The range of `c' is the entire loop clause. @} +while char c = getchar; + c /= char_eof +do + ... use c ... +od +@end example + @node Nihils @section Nihils