[GNU68][COMMITTED] New draft GNU68-2025-006-asymmetric-pragmat-delimiters

Jose E. Marchesi jemarch@gnu.org
Sun Nov 16 16:32:22 GMT 2025


---
 ...025-006-asymmetric-pragmat-delimiters.texi | 230 ++++++++++++++++++
 Makefile.am                                   |  12 +-
 2 files changed, 241 insertions(+), 1 deletion(-)
 create mode 100644 GNU68-2025-006-asymmetric-pragmat-delimiters.texi

diff --git a/GNU68-2025-006-asymmetric-pragmat-delimiters.texi b/GNU68-2025-006-asymmetric-pragmat-delimiters.texi
new file mode 100644
index 0000000..17e9b84
--- /dev/null
+++ b/GNU68-2025-006-asymmetric-pragmat-delimiters.texi
@@ -0,0 +1,230 @@
+\input texinfo  @c -*-texinfo-*-
+@c %**start of header
+@setfilename GNU68-2025-006-asymmetric-pragmat-delimiters.info
+@settitle Asymmetric pragmat delimiters in Algol 68
+@afourpaper
+@c %**end of header
+
+@c Macro for para-notions.
+
+@iftex
+@macro para{arg}
+@strong{\arg\}
+@end macro
+@end iftex
+
+@ifhtml
+@macro para{arg}
+@strong{\arg\}
+@end macro
+@end ifhtml
+
+@ifnottex
+@ifnothtml
+@macro para{arg}
+arg
+@end macro
+@end ifnothtml
+@end ifnottex
+
+@c Macro for bold-tags.  In TeX and HTML they expand to proper bold words,
+@c in other formats it resorts to upper stropping.
+@iftex
+@macro B{tag}
+@strong{\tag\}
+@end macro
+@end iftex
+
+@ifhtml
+@macro B{tag}
+@strong{\tag\}
+@end macro
+@end ifhtml
+
+@ifnottex
+@ifnothtml
+@macro B{tag}
+@sc{\tag\}
+@end macro
+@end ifnothtml
+@end ifnottex
+
+@c %** start of document
+
+@copying
+Copyright @copyright{} 2025 Jose E. Marchesi.
+
+@quotation
+You can redistribute and/or modify this document under the terms of
+the GNU General Public License as published by the Free Software
+Foundation, either version 3 of the License, or (at your option) any
+later version.
+@end quotation
+@end copying
+
+@ifinfo
+@dircategory GNU Algol 68 Working Group
+@direntry
+* GNU68-2025-006-asymmetric-pragmat-delimiters:       Asymmetric pragmat delimiters in Algol 68.
+@end direntry
+@end ifinfo
+
+@paragraphindent none
+@setchapternewpage off
+
+@titlepage
+@title Asymmetric pragmat delimiters in Algol 68
+@subtitle GNU68-2025-006 (draft)
+@author by Jose E. Marchesi
+@page
+@vskip 0pt plus 1filll
+@sp 1
+@insertcopying
+@end titlepage
+
+@c @contents
+
+@ifnottex
+@node Top
+@top Asymmetric pragmat delimiters in Algol 68
+
+@center GNU68-2025-006 (draft)
+
+@insertcopying
+@end ifnottex
+
+@iftex
+@heading Foreword
+@end iftex
+
+The following specification has been released under the auspices of
+the GNU Algol 68 Working Group, and has been scrutinized to ensure
+that
+
+@enumerate a
+@item
+it is strictly upwards-compatible with Algol 68,
+@item
+it is consistent with the philosophy and orthogonal framework of
+the language, and
+@item
+it fills a clearly discernible gap in the expressive power of
+that language.
+@end enumerate
+
+The source of this document can be found at
+@url{https://git.sr.ht/~jemarch/gnu68}.
+
+The informal description of this proposal introduces the proposed new
+language features, providing a rationale and usage examples.
+
+The formal definition of this proposal uses the existing formalism and
+conventions of the Revised Report, and it is expressed as
+modifications to the Report.
+
+Finally, the implementation notes of this proposal describes a way in
+which the features added by this specification can be implemented.  No
+implementer should feel committed to do things as described there; the
+same language facilities may well be implementable in other ways, more
+suitable to specific implementations.
+
+@ifnottex
+@menu
+* Informal Description::
+* Formal Description::
+* Implementation Notes::
+@end menu
+@end ifnottex
+
+@c ---------------------------------------------------------------------
+@c Informal Description
+@c ---------------------------------------------------------------------
+
+@node Informal Description
+@chapter Informal Description
+
+@unnumberedsec Pragmats in Algol 68
+
+The Algol 68 strict language defines two styles for pragmats, each
+style using a different delimiter symbol:
+
+@multitable @columnfractions .50 .50
+@item @code{bold pragmat symbol} @tab @code{@B{pragmat}}
+@item @code{style i pragmat symbol} @tab @code{@B{pr}}
+@end multitable
+
+In both cases the same symbol marks the beginning and end of the
+pragmat: a bold pragmat, for example, starts with @code{@B{pragmat}}
+and it must be ended by another @code{@B{pragmat}}.  In the sequel we
+will refer to this kind of delimiters as @dfn{symmetrical}.
+
+Pragmats using symmetrical delimiters cannot be nested, but this is
+unlikely to have any practical significance, since nesting one
+annotation for the compiler inside another is not something commonly
+done.  This is in contrast with other constructs like comments, which
+are often nested.
+
+However, a problem of using symmetrical pragmat delimiters is that
+they make it necessary to inspect the whole source in order to
+determine, given a pragmat delimiter, whether it begins or finishes a
+pragmat.  For programmers this can be confusing and error prone, for
+programs such as text editors wanting to highlight a comment, or to
+skip over it, this is very inefficient.
+
+@unnumberedsec Asymmetric pragmat delimiters in Algol 68
+
+The shortcomings described in the previous section motivate the
+addition of asymmetric pragmat delimiters to Algol 68.
+
+Representations of pragmats are defined for the @dfn{bold} and
+@dfn{i} styles, both of which use asymmetric delimiters:
+
+@multitable @columnfractions .50 .50
+@item @code{bold pragmat begin symbol} @tab @code{@B{order}}
+@item @code{bold pragmat end symbol} @tab @code{@B{redro}}
+@item @code{style i pragmat begin symbol} @tab @code{[[}
+@item @code{style i pragmat end symbol} @tab @code{]]}
+@end multitable
+
+The main reason for choosing @code{[[} and @code{]]} for representing
+style i pragmat delimiters is that it is the syntax used by several
+other programming languages to denote compiler attributes.  Algol 68
+pragmats play similar roles to these attributes.  Therefore the
+resulting notation shall be familiar to programmers.
+
+@node Formal Description
+@chapter Formal Description
+
+New symbols have been invented for opening and closing comments:
+
+@smallexample
+9.4.1.h
+  bold pragmat begin symbol                   ORDER
+  bold pragmat end symbol                     REDRO
+  style i pragmat begin symbol                [[
+  style i pragmat end symbol                  ]]
+@end smallexample
+
+Syntax of pragments is expanded to also include asymmetric  pragmats:
+
+@smallexample
+9.2.1
+
+b) PRAGMENT@{a@} : ... ; STYLE asymmetric pragmat@{d@}.
+d) STYLE asymmetric pragmat@{b@} :
+     STYLE pragmat begin symbol@{94h,-@},
+       STYLE PRAGMENT item@{c@} sequence option,
+       STYLE pragmat end symbol@{94h,-@}.
+@end smallexample
+
+@node Implementation Notes
+@chapter Implementation Notes
+
+The new pragmats are introduced as an addition to the existing
+pragmats, with straightforward changes to the lexical analyzer.  Note
+the pragmats with asymmetric delimiters are still non-nestable.
+
+It is recommended for implementations offering stropping regimes based
+on reserved words to only recognize pragmats with asymmetric
+delimiters, and of these only the brief style.
+@bye
diff --git a/Makefile.am b/Makefile.am
index b6a33a9..6c9a1ff 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -21,7 +21,8 @@ info_TEXINFOS = GNU68-2025-001-unsafe.texi \
                 GNU68-2025-002-bold-taggles.texi \
                 GNU68-2025-003-andth-orel.texi \
                 GNU68-2025-004-supper.texi \
-                GNU68-2025-005-nestable-comments.texi
+                GNU68-2025-005-nestable-comments.texi \
+                GNU68-2025-006-asymmetric-pragmat-delimiters.texi
 AM_MAKEINFOFLAGS = --set-customization-variable CHECK_NORMAL_MENU_STRUCTURE=true
 
 pdf: $(info_TEXINFOS)
@@ -30,6 +31,7 @@ pdf: $(info_TEXINFOS)
 	$(TEXI2PDF) $(srcdir)/GNU68-2025-003-andth-orel.texi
 	$(TEXI2PDF) $(srcdir)/GNU68-2025-004-supper.texi
 	$(TEXI2PDF) $(srcdir)/GNU68-2025-005-nestable-comments.texi
+	$(TEXI2PDF) $(srcdir)/GNU68-2025-006-asymmetric-pragmat-delimiters.texi
 
 html: $(info_TEXINFOS)
 	$(MAKEINFO) --html --no-number-footnotes \
@@ -57,6 +59,11 @@ html: $(info_TEXINFOS)
                     --css-ref=gnu68.css --output GNU68-2025-005-nestable-comments.html \
                     $(srcdir)/GNU68-2025-005-nestable-comments.texi
 	-cp -f $(top_srcdir)/gnu68.css $(builddir)/GNU68-2025-005-nestable-comments.html/
+	$(MAKEINFO) --html --no-number-footnotes \
+                    -c TOP_NODE_UP_URL=/ \
+                    --css-ref=gnu68.css --output GNU68-2025-006-asymmetric-pragmat-delimiters.html \
+                    $(srcdir)/GNU68-2025-006-asymmetric-pragmat-delimiters.texi
+	-cp -f $(top_srcdir)/gnu68.css $(builddir)/GNU68-2025-006-asymmetric-pragmat-delimiters.html/
 
 text: $(info_TEXINFO)
 	$(MAKEINFO) --plaintext $(srcdir)/GNU68-2025-001-unsafe.texi \
@@ -69,6 +76,8 @@ text: $(info_TEXINFO)
           > GNU68-2025-004-supper.txt
 	$(MAKEINFO) --plaintext $(srcdir)/GNU68-2025-005-nestable-comments.texi \
           > GNU68-2025-005-nestable-comments.txt
+	$(MAKEINFO) --plaintext $(srcdir)/GNU68-2025-006-asymmetric-pragmat-delimiters.texi \
+          > GNU68-2025-006-asymmetric-pragmat-delimiters.txt
 
 # Cleanup.
 
@@ -78,3 +87,4 @@ clean-local:
 	rm -f GNU68-2025-003-andth-orel.pdf
 	rm -f GNU68-2025-004-supper.pdf
 	rm -f GNU68-2025-005-nestable-comments.pdf
+	rm -f GNU68-2025-006-asymmetric-pragmat-delimiters.pdf
-- 
2.30.2



More information about the Algol68 mailing list