From 0085ea1c2c7ddf32f2ad239da93f27257cf2bf6d Mon Sep 17 00:00:00 2001 From: _ov4 Date: Wed, 21 Oct 2026 12:42:53 +0000 Subject: docs(agents): split CONVENTIONS.md into topic files under AGENTS/CONVENTIONS Co-Authored-By: Claude Sonnet 5.5 --- AGENTS/CONVENTIONS/STRINGS.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 AGENTS/CONVENTIONS/STRINGS.md (limited to 'AGENTS/CONVENTIONS/STRINGS.md') 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. -- cgit v1.3.1-4-g156e