aboutsummaryrefslogtreecommitdiff
path: root/AGENTS/CONVENTIONS/STRINGS.md
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-21 12:42:53 +0000
committer_ov4 <ov4@ov4.org>2026-10-21 12:42:53 +0000
commit0085ea1c2c7ddf32f2ad239da93f27257cf2bf6d (patch)
treef683fbdbf764e3b20bc4eb5c99c528c5585d1d46 /AGENTS/CONVENTIONS/STRINGS.md
parent37766e7471b2c855923a000df7286a7b79b83d4a (diff)
docs(agents): split CONVENTIONS.md into topic files under AGENTS/CONVENTIONS
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Diffstat (limited to 'AGENTS/CONVENTIONS/STRINGS.md')
-rw-r--r--AGENTS/CONVENTIONS/STRINGS.md20
1 files changed, 20 insertions, 0 deletions
diff --git a/AGENTS/CONVENTIONS/STRINGS.md b/AGENTS/CONVENTIONS/STRINGS.md
new file mode 100644
index 0000000..2908167
--- /dev/null
+++ b/AGENTS/CONVENTIONS/STRINGS.md
@@ -0,0 +1,20 @@
+# Conventions: STRING values and ownership
+
+Part of [Load-bearing conventions](../CONVENTIONS.md).
+
+**STRING values use the class machinery.** `string.cps` owns a std::string through an
+internal handle. Ordinary literals construct STRING through NEW(C_STRING); suffixed
+`"text"C` literals produce C_STRING directly. Ordinary literals retain legacy NUL
+truncation. `StringValueGen.cc` bridges construction, C_STR access and file operands;
+INPUT calls READ_INPUT. String functions and all concatenation/comparison operators
+are ordinary library definitions, with exact overload selection. Comparisons use
+case-sensitive byte ordering. A missing STRING class or required bridge method is a
+compile error.
+
+**Ownership follows value copies.** STRING constructors/assignment prevent shared
+handles. Records and BYVAL arrays containing STRING recursively copy their
+string-bearing fields/elements; RETURN and temporary cleanup preserve ownership.
+C_STRING casts borrow a STRING buffer or construct an owning STRING copy in the other
+direction. FileHandler owns copied open-file names and frees them on close; READFILE
+buffers are copied into STRING and released. Explicit MemoryHandler allocations remain
+separate from these internal objects.