aboutsummaryrefslogtreecommitdiff
path: root/doc/language/function
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-22 15:32:49 +0000
committer_ov4 <ov4@ov4.org>2026-10-22 15:32:49 +0000
commit713a313b06256a13ddefa5e257e3b80f8aa808ba (patch)
tree0288e9e9e44b9765cf2285fa3adaf82963612180 /doc/language/function
parent5a5a14be5e2683a42906da4b2ad19690e230c871 (diff)
feat(codegen): convert implicitly between CHAR and STRING
A CHAR becomes a one-character STRING in &, comparisons, assignment, parameter passing and RETURN. A STRING becomes a CHAR in assignment, parameter passing and RETURN, with a runtime error when its length is not 1. CHAR with INTEGER or BOOLEAN still does not convert. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Diffstat (limited to 'doc/language/function')
-rw-r--r--doc/language/function/cpsc-function-chr.7.md2
1 files changed, 1 insertions, 1 deletions
diff --git a/doc/language/function/cpsc-function-chr.7.md b/doc/language/function/cpsc-function-chr.7.md
index cc471a5..3ae8612 100644
--- a/doc/language/function/cpsc-function-chr.7.md
+++ b/doc/language/function/cpsc-function-chr.7.md
@@ -14,7 +14,7 @@ CHR(code : INTEGER) RETURNS STRING
Provided by the standard string library, loaded and linked by default.
-Convert the low eight bits of code to a one-byte string. The result is STRING, not CHAR. Use ASCII codes 1 to 127 for ordinary text; code 0 produces one NUL byte, so LENGTH(CHR(0)) is 1.
+Convert the low eight bits of code to a one-byte string. The result is STRING, not CHAR, but a STRING of length 1 converts implicitly to CHAR on assignment. Use ASCII codes 1 to 127 for ordinary text; code 0 produces one NUL byte, so LENGTH(CHR(0)) is 1.
# EXAMPLE