[A68-JARGON][COMMITTED] New term: The Bend
Jose E. Marchesi
jemarch@gnu.org
Fri Jun 12 11:52:49 GMT 2026
---
src/Makefile.am | 2 +
src/a68-jargon.texi | 3 ++
src/subname.texi | 3 +-
src/the-bend.texi | 103 ++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 110 insertions(+), 1 deletion(-)
create mode 100644 src/the-bend.texi
diff --git a/src/Makefile.am b/src/Makefile.am
index 3cfd3e5..9a7f9cf 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -66,6 +66,7 @@ a68_jargon_TEXINFOS = actual-declarer.texi \
subscript.texi \
symbol.texi \
taggle.texi \
+ the-bend.texi \
token.texi \
trimmer.texi \
uninitiated-reader.texi \
@@ -134,6 +135,7 @@ man_MANS = a68-jargon.7algol \
subscript.7algol \
symbol.7algol \
taggle.7algol \
+ the-bend.7algol \
token.7algol \
trimmer.7algol \
uninitiated-reader.7algol \
diff --git a/src/a68-jargon.texi b/src/a68-jargon.texi
index e6e18df..afcb5db 100644
--- a/src/a68-jargon.texi
+++ b/src/a68-jargon.texi
@@ -185,6 +185,7 @@ Language
* Symbol::
@c * Terminating::
@c * Transput::
+* The Bend::
* Token::
* Trimmer::
@c * Value::
@@ -414,6 +415,7 @@ Jose E. Marchesi <jemarch@gnu.org>
* Subname::
* Subscript::
* Symbol::
+* The Bend::
* Token::
* Trimmer::
* Unworthy Character::
@@ -465,6 +467,7 @@ Jose E. Marchesi <jemarch@gnu.org>
@include subname.texi
@include subscript.texi
@include symbol.texi
+@include the-bend.texi
@include token.texi
@include trimmer.texi
@include unworthy-character.texi
diff --git a/src/subname.texi b/src/subname.texi
index 037b048..4fbfa54 100644
--- a/src/subname.texi
+++ b/src/subname.texi
@@ -53,6 +53,7 @@ with sub-names''}.
@subheading See Also
@itemize @bullet
+@item @ref{The Bend}
@item [II 1.4.1.2]
@end itemize
@@ -61,6 +62,6 @@ with sub-names''}.
Jose E. Marchesi <jemarch@gnu.org>
@c man end
@c man begin SEEALSO
-[II 1.4.1.2]
+the-bend(7algol), [II 1.4.1.2]
@c man end
@end ignore
diff --git a/src/the-bend.texi b/src/the-bend.texi
new file mode 100644
index 0000000..c9a728b
--- /dev/null
+++ b/src/the-bend.texi
@@ -0,0 +1,103 @@
+@c This file is part of the Algol 68 Jargon File.
+@c
+@c Copyright (C) 2026 Jose E. Marchesi
+@c
+@c You can redistribute and/or modify this document under the terms of
+@c the GNU General Public License as published by the Free Software
+@c Foundation, either version 3 of the License, or (at your option) any
+@c later version.
+@c
+@c Alternatively, permission is granted to copy, distribute and/or modify
+@c this document under the terms of the GNU Free Documentation License,
+@c Version 1.3 or any later version published by the Free Software
+@c Foundation; with no Invariant Sections, no Front-Cover Texts, and no
+@c Back-Cover Texts.
+
+@node The Bend
+@section The Bend
+
+@c man title the-bend subnames
+
+@subheading Meaning
+@c man begin MEANING
+
+Assignation in Algol 68 works with as follows: at the left side there
+is a @code{@B{ref}} expression, whereas at the right side it is
+expected to have a value of the referred mode. The name at the left
+side is then made to refer to the value at the right side.
+
+This works for any kind of value supported in the language, from plain
+values like integral or real numbers to structured or multiple values,
+and even routines:
+
+@example
+age := 45;
+name := "Jose";
+person := ("Jose Marchesi", 45);
+averages := (5.5, 5.6, 4.8, 3.9);
+callback := (int n) int: n + 2
+@end example
+
+Now, stowed values are composed of further values, namely the elements
+of a multiple value and the fields of a structured value. The
+elements of a multiple can be accessed via slicing, like in
+@code{averages[2]}, and the fields of a structure can be accessed via
+selection, like in @code{age @B{of} person}.
+
+Names are not stowed values, however, and during the definition of the
+language a problem became obvious: how would you modify part of a
+multiple or a structured value? Suppose for example we want to adjust
+the second average from 5.6 to 5.7. Given the name @code{average} we
+could do it by:
+
+@example
+@{ Previous value was (5.5, 5.6, 4.8, 3,9) @}
+averages := (5.5, 5.7, 4.8, 3.9)
+@end example
+
+This sucked, of course, and any programmer would expect to be able to
+just update the single element and be done with it. This led to the
+introduction of @R{Subname,sub-names}: slicing or selecting a name,
+which must be a @code{@B{ref}} to some stowed mode, yields a sub-name.
+We can then simply use the resulting sub-name in an assignation:
+
+@example
+averages[1] := 5.7
+@end example
+
+We say that the sliced or selected name, in this case @code{averages},
+is @dfn{endowed with sub-names}.
+
+Of course, due to orthogonality, sub-names should be equivalent to
+``regular'' names in every aspect: it shall be possible to pass them
+as parameters, etc. This is indeed the case, save for an obscure
+corner case involving sub-names of flexible names, which are somewhat
+restricted due to scope reasons, and such restrictions enforced by the
+syntax.
+
+The endowment of @R{Subname,subnames} to stowed names, allowing them
+to be sliced and selected, and its fitting in the language came to be
+known as @dfn{the bend}, because it turned out very difficult to
+figure out, and formalize. As Charles Lindsey puts it:
+
+@quotation
+Getting this correct in the syntax of selections and slices nearly
+drove the authors ``round the bend''; hence, the title given to it.
+@end quotation
+@c man end
+
+@subheading See Also
+
+@itemize @bullet
+@item @ref{Subname}
+@item Assignation
+@end itemize
+
+@ignore
+@c man begin AUTHOR
+Jose E. Marchesi <jemarch@gnu.org>
+@c man end
+@c man begin SEEALSO
+subname(7algol), assignation(7algol)
+@c man end
+@end ignore
--
2.39.5
More information about the Algol68
mailing list