Host reads, closes and writes have separate runtime faults Adopted November 8, 2026 · 6.0.0 · In progress
Problem A failure while consuming bytes differs from failing to release a resource or deliver output. Callers need to identify the failed operation.
Decision Use TPZ4008 for input, TPZ4009 for close and TPZ4010 for output at runtime. Each code has its own operation cause.
Alternatives considered Use one host I/O code with different causes. The code alone would not identify the failed operation.Why The diagnostic identity indicates which operation failed.
Changed rules Host write failures →
Resolved pending items Host-write fault identity →
WriteLine returns unit and reports host write failure as a runtime fault Adopted November 7, 2026 · 6.0.0 · In progress
Problem The output destination can refuse a write. The language needs to state both what the call returns and how failure is reported.
Decision Keep the unit signature of std. io. write Line. A host write failure produces a structured runtime fault.
Examples
A successful write has a Unit result check · checking · Verification · not-run
write-line-unit-result.tpz A successful write has a Unit result Open in Playground → import std.io let result: () = io. writeLine ( "hello" ) Expected output Exit code 0
No stdout. Expected result Expected result Checking accepts the program. Exit code 0.
No stderr.
No stdout.
This exact example has not been executed.
A write result cannot use Result propagation reject · checking · Verification · not-run
write-line-not-result.tpz A write result cannot use Result propagation Open in Playground → import std.io function greeting () -> Result < (), string > { io. writeLine ( "hello" ) ? Ok(()) } Expected output Nonzero exit
No stdout. Expected result Expected result Rejection during check. Nonzero exit.
No stdout.
This exact example has not been executed.
Alternatives considered Return Result from output calls. Existing callers would have to handle a different return type.Let the host decide how the program ends. Topaz must define how a host write failure is observed.Why The call retains its signature and the host failure is visible to Topaz.
Changed rules Host write failures →writeLine contract →
Resolved pending items Output boundaries and failures →
A host output fault points to the failed write call Adopted November 7, 2026 · 6.0.0 · In progress
Problem Lumping an output failure together with an unrelated runtime fault makes the cause hard to identify. Multiple writes also need a location that identifies the one that failed.
Decision Use a dedicated runtime fault for a host write failure in write Line and point its diagnostic at that call.
Alternatives considered Broaden an existing runtime fault to cover output failure. The diagnostic would not distinguish a host write from the other operation.Why The fault identifies both the operation and the failed call.
Changed rules Host write failures →
Partly answered pending items Host-write fault identity →
Collection length, keys and values are properties Adopted November 7, 2026 · 6.0.0 · In progress
Problem Reading the same information can require parentheses for one collection and property access for another. That complicates moving the lookup.
Decision Use properties for length, keys and values on collections.
Examples
Read the same properties on core collections run · running · Verification · not-run
main.tpz Read the same properties on core collections Open in Playground → import std.io let array = [ 2 , 3 ] let entries = map { "name" : "Topaz" } let values = set { 2 , 3 } io. writeLine ( "{array.length}:{entries.length}:{values.length}" ) io. writeLine (entries.keys[ 0 ]) io. writeLine (entries.values[ 0 ]) Expected output Exit code 0
2:1:2
name
Topaz
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Read a byte sequence size run · running · Verification · not-run
main.tpz Read a byte sequence size import std.bytes { Bytes } import std.io let bytes = Bytes . empty () let size: int = bytes.length io. writeLine ( "{size}" ) Expected output Exit code 0
0
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Read JSON object keys run · running · Verification · not-run
main.tpz Read JSON object keys import std.json import std.test import std.io let object = test. assertOk (json. parse ( "\{\"name\":\"Topaz\"\}" )) let array = test. assertOk (json. parse ( "[]" )) let scalar = test. assertOk (json. parse ( "42" )) let names: Option < Array < string >> = object.keys test. assertEq (test. assertSome (names)[ 0 ], "name" ) test. assertNone (array.keys) test. assertNone (scalar.keys) io. writeLine ( "JSON keys read" ) Expected output Exit code 0
JSON keys read
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Alternatives considered Keep a mixture of methods and properties. The same observation would use different syntax across collections.Why Collection information has a consistent access style.
Changed rules Read collection sizes, keys, and values as properties →
An empty collection has length zero Adopted November 7, 2026 · 6.0.0 · In progress
Problem Reading the length and using an emptiness accessor could express the same state twice. The condition can be written directly.
Decision Test emptiness with length == 0. Remove is Empty from Bytes, Map and Set.
Examples
Length zero identifies empty bytes, maps, and sets run · runtime · Verification · not-run
main.tpz Length zero identifies empty bytes, maps, and sets import std.io let values: Map < string , int > = map {} let names: Set < string > = set {} io. writeLine ( "{("". encodeUtf8 ()).length == 0 }" ) io. writeLine ( "{values.length == 0 }" ) io. writeLine ( "{names.length == 0 }" ) io. writeLine ( "{("ink". encodeUtf8 ()).length == 0 }" ) Expected output Exit code 0
true
true
true
false
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Alternatives considered Keep is Empty. There would remain two ways to test whether length is zero.Why The code states its emptiness condition directly in terms of length.
Changed rules Read collection sizes, keys, and values as properties →
An out-of-bounds byte slice fails at runtime Adopted November 7, 2026 · 6.0.0 · Being verified
Problem A boundary past the end can return a shorter slice that looks valid. The caller then cannot see the indexing mistake.
Decision A byte slice excludes its end and requires 0 <= start <= end <= length. Invalid bounds produce TPZ4001 at runtime.
Examples
Select empty and nonempty intervals run · running · Verification · not-run
main.tpz Select empty and nonempty intervals Open in Playground → import std.io let value = "abcd" . encodeUtf8 () io. writeLine (value. slice ( 0 , 0 ). toHex ()) io. writeLine (value. slice ( 1 , 3 ). toHex ()) io. writeLine (value. slice ( 4 , 4 ). toHex ()) io. writeLine (value. toHex ()) Expected output Exit code 0
6263
61626364
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Reject a negative slice start run · running · Verification · not-run
main.tpz Reject a negative slice start Open in Playground → import std.bytes { Bytes } let value = "abcd" . encodeUtf8 () value. slice ( - 1 , 2 ) Expected output Nonzero exit
No stdout. Expected result Expected result Rejection during run. Nonzero exit.
No stdout.
This exact example has not been executed.
Reject an inverted byte interval run · running · Verification · not-run
main.tpz Reject an inverted byte interval Open in Playground → import std.bytes { Bytes } let value = "abcd" . encodeUtf8 () value. slice ( 3 , 2 ) Expected output Nonzero exit
No stdout. Expected result Expected result Rejection during run. Nonzero exit.
No stdout.
This exact example has not been executed.
Reject an endpoint beyond the sequence run · running · Verification · not-run
main.tpz Reject an endpoint beyond the sequence Open in Playground → import std.bytes { Bytes } let value = "abcd" . encodeUtf8 () value. slice ( 0 , 5 ) Expected output Nonzero exit
No stdout. Expected result Expected result Rejection during run. Nonzero exit.
No stdout.
This exact example has not been executed.
Alternatives considered Clamp the requested bounds to the input. An index error would silently select a different valid range.Why Either the requested slice is returned or its bad bounds are reported.
Changed rules Select explicit byte intervals →
Adopted November 7, 2026 · 6.0.0 · Being verified
Problem Multiple spellings of a byte make it harder to check input follows its expected format. Prefixes and spaces also need a clear rule.
Decision Read each byte as two lowercase hexadecimal digits. Reject uppercase, prefixes, separators and whitespace.
Examples
Decode byte pairs and emit lowercase text run · running · Verification · not-run
main.tpz Decode byte pairs and emit lowercase text Open in Playground → import std.bytes { Bytes } import std.io import std.test io. writeLine (test. assertOk ( Bytes . fromHex ( "" )). toHex ()) io. writeLine (test. assertOk ( Bytes . fromHex ( "000f80ff" )). toHex ()) Expected output Exit code 0
000f80ff
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Reject malformed hexadecimal strings run · running · Verification · not-run
main.tpz Reject malformed hexadecimal strings Open in Playground → import std.bytes { Bytes } import std.io for text in ([ "0" , "gg" , "0x00" , "00 11" , "00" ]) { match ( Bytes . fromHex (text)) { case Err(_) => io. writeLine ( "invalid hex" ) case Ok(_) => io. writeLine ( "accepted" ) } } Expected output Exit code 0
invalid hex
invalid hex
invalid hex
invalid hex
invalid hex
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout invalid hex invalid hex invalid hex invalid hex invalid hex This exact example has not been executed.
Reject uppercase hexadecimal input run · running · Verification · not-run
main.tpz Reject uppercase hexadecimal input Open in Playground → import std.bytes { Bytes } import std.io match ( Bytes . fromHex ( "CAfe" )) { case Err(_) => io. writeLine ( "uppercase rejected" ) case Ok(_) => io. writeLine ( "accepted" ) } Expected output Exit code 0
uppercase rejected
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Alternatives considered Accept either letter case. The same byte would have more than one spelling.Why Input can be checked against the same format used for hex output.
Changed rules Use a canonical hexadecimal spelling →
Decompression consumes one complete stream Adopted November 7, 2026 · 6.0.0 · Being verified
Problem Valid compressed data can be followed by another frame or by stray bytes. A successful partial decode would leave the caller unaware of the rest.
Decision Consume a single complete stream, frame, or member as defined by the format. Reject additional frames and trailing bytes. Examples
Reject truncated streams and trailing bytes run · running · Verification · not-run
main.tpz Reject truncated streams and trailing bytes Open in Playground → import std.bytes { Bytes } import std.io import std.test for hex in ([ "" , "010100feff" , "010000ffff00" , "070000" ]) { match (test. assertOk ( Bytes . fromHex (hex)). deflateDecompress ()) { case Err(_) => io. writeLine ( "invalid DEFLATE" ) case Ok(_) => io. writeLine ( "accepted" ) } } Expected output Exit code 0
invalid DEFLATE
invalid DEFLATE
invalid DEFLATE
invalid DEFLATE
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout invalid DEFLATE invalid DEFLATE invalid DEFLATE invalid DEFLATE This exact example has not been executed.
Reject a truncated member and an invalid checksum run · running · Verification · not-run
main.tpz Reject a truncated member and an invalid checksum Open in Playground → import std.bytes { Bytes } import std.io import std.test for hex in ([ "1f8b0800" , "1f8b08000000000000ff010500faff68656c6c6f87a6103605000000" ]) { match (test. assertOk ( Bytes . fromHex (hex)). gzipDecompress ()) { case Err(_) => io. writeLine ( "invalid gzip" ) case Ok(_) => io. writeLine ( "accepted" ) } } Expected output Exit code 0
invalid gzip
invalid gzip
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Reject missing block data and trailing bytes run · running · Verification · not-run
main.tpz Reject missing block data and trailing bytes Open in Playground → import std.bytes { Bytes } import std.io import std.test for hex in ([ "" , "28b52ffd20052900006869" , "28b52ffd200001000000" ]) { match (test. assertOk ( Bytes . fromHex (hex)). zstdDecompress ()) { case Err(_) => io. writeLine ( "invalid Zstandard" ) case Ok(_) => io. writeLine ( "accepted" ) } } Expected output Exit code 0
invalid Zstandard
invalid Zstandard
invalid Zstandard
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout invalid Zstandard invalid Zstandard invalid Zstandard This exact example has not been executed.
Alternatives considered Chain multiple frames or ignore trailing bytes. One call would either accept a different input boundary or leave part of the input unchecked.Why Successful decompression confirms that the whole input was one compressed unit.
Changed rules Distinguish raw DEFLATE from zlib framing →Read and write complete gzip members →Use Zstandard frames and explicit effort levels →
Decompression accepts an output byte limit Adopted November 16, 2026 · 6.0.0 · Being verified
Problem Even a small compressed input can expand into a large output. The amount a caller can handle depends on the program.
Decision Decompression functions accept an optional max Bytes argument and return Err if the decoded size exceeds it. Omitting the argument leaves the output size unlimited. Examples
Gzip decoding honors a caller-specified output limit run · runtime · Verification · not-run
main.tpz Gzip decoding honors a caller-specified output limit import std.io import std.test let encoded = test. assertOk ( "hello" . encodeUtf8 (). gzipCompress ()) io. writeLine (test. assertOk (encoded. gzipDecompress ( 5 )). toHex ()) match (encoded. gzipDecompress ( 4 )) { case Err(_) => io. writeLine ( "limit exceeded" ) case Ok(_) => io. writeLine ( "accepted" ) } io. writeLine (test. assertOk (encoded. gzipDecompress ()). toHex ()) Expected output Exit code 0
68656c6c6f
limit exceeded
68656c6c6f
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout 68656c6c6f limit exceeded 68656c6c6f This exact example has not been executed.
Deflate and Zstandard honor an output byte limit run · runtime · Verification · not-run
main.tpz Deflate and Zstandard honor an output byte limit import std.io import std.test let data = "hello" . encodeUtf8 () let raw = test. assertOk (data. deflateCompress ()) let zstd = test. assertOk (data. zstdCompress ()) for outcome in ([raw. deflateDecompress ( 4 ), zstd. zstdDecompress ( 4 )]) { let failed = match (outcome) { case Err(_) => true case Ok(_) => false } io. writeLine ( "{failed}" ) } Expected output Exit code 0
true
true
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Alternatives considered Apply one fixed limit everywhere. It could reject valid large inputs or be too high to stop hazardous ones.Why Callers can set a limit appropriate to their input and available capacity.
Changed rules Read and write complete gzip members →Distinguish raw DEFLATE from zlib framing →Use Zstandard frames and explicit effort levels →
Path operations use normalized lexical components Adopted November 7, 2026 · 6.0.0 · Being verified
Problem A caller can ask for the parent of a single name or change an extension on a name ending in a dot. Joining also needs a rule for what counts as a child component.
Decision Operate on normalized lexical components. The parent of a single component is .. A trailing dot gives an empty extension. A replacement extension starting with a dot is rejected. Validate a child before joining it to a path. Examples
Reject invalid child text before joining run · running · Verification · not-run
main.tpz Reject invalid child text before joining Open in Playground → import std.path { Path } import std.test import std.io let base = test. assertOk ( Path . from ( "chapters" )) for child in ([ "" , "/outside" , "C:/outside" , "../../outside" ]) { match (base. join (child)) { case Err(_) => io. writeLine ( "rejected" ) case Ok(_) => io. writeLine ( "accepted" ) } } io. writeLine (base. toString ()) Expected output Exit code 0
rejected
rejected
rejected
rejected
chapters
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout rejected rejected rejected rejected chapters This exact example has not been executed.
Inspect the final component and the relative root run · running · Verification · not-run
main.tpz Inspect the final component and the relative root Open in Playground → import std.path { Path } import std.test import std.io let file = test. assertOk ( Path . from ( "chapters/main.tpz" )) io. writeLine (test. assertSome (file. parent ()). toString ()) io. writeLine (test. assertSome (file. fileName ())) io. writeLine (test. assertSome (file. extension ())) let root = test. assertOk ( Path . from ( "." )) test. assertNone (root. parent ()) test. assertNone (root. fileName ()) test. assertNone (root. extension ()) io. writeLine (root. toString ()) Expected output Exit code 0
chapters
main.tpz
tpz
.
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Keep the relative root as the parent of one component run · running · Verification · not-run
main.tpz Keep the relative root as the parent of one component Open in Playground → import std.path { Path } import std.test import std.io let file = test. assertOk ( Path . from ( "main.tpz" )) match (file. parent ()) { case Some(parent) => io. writeLine (parent. toString ()) case None() => io. writeLine ( "missing" ) } Expected output Exit code 0
.
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Distinguish an absent extension from an empty extension run · running · Verification · not-run
main.tpz Distinguish an absent extension from an empty extension Open in Playground → import std.path { Path } import std.test import std.io for name in ([ "README" , ".env" , ".env.local" , "archive.tar.gz" , "trailing." ]) { let file = test. assertOk ( Path . from (name)) match (file. extension ()) { case Some(extension) => io. writeLine ( "present [{extension}]" ) case None() => io. writeLine ( "absent" ) } } Expected output Exit code 0
absent
absent
present [local]
present [gz]
present []
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout absent absent present [local] present [gz] present [] This exact example has not been executed.
Reject a second suffix spelling and a path without a file name run · running · Verification · not-run
main.tpz Reject a second suffix spelling and a path without a file name Open in Playground → import std.path { Path } import std.test import std.io let file = test. assertOk ( Path . from ( "chapter.txt" )) for extension in ([ ".pdf" , "pdf/extra" , "pdf\\extra" ]) { match (file. withExtension (extension)) { case Err(_) => io. writeLine ( "rejected" ) case Ok(_) => io. writeLine ( "accepted" ) } } let root = test. assertOk ( Path . from ( "." )) match (root. withExtension ( "pdf" )) { case Err(_) => io. writeLine ( "root rejected" ) case Ok(_) => io. writeLine ( "root accepted" ) } Expected output Exit code 0
rejected
rejected
rejected
root rejected
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout rejected rejected rejected root rejected This exact example has not been executed.
Why Path components have consistent behavior before any filesystem access.
Changed rules Inspect and transform normalized paths →
Regex escape names reserve ASCII letters and digits Adopted November 16, 2026 · 6.0.0 · In progress
Problem If Unicode categories govern what follows a backslash, a Unicode update can change pattern syntax. Literal punctuation and other characters also need a rule.
Decision Reserve ASCII letters and digits after a backslash for escape names. Reject undefined names when compiling the regex. Read any other scalar after a backslash as that literal character. Examples
ASCII escape names and a literal Korean character run · runtime · Verification · not-run
main.tpz ASCII escape names and a literal Korean character Open in Playground → import std.io import std.regex { Regex } match ( Regex . compile ( "\\가" )) { case Ok(pattern) => io. writeLine ( "{pattern. isMatch ("가")}" ) case Err(_) => io. writeLine ( "compile failed" ) } match ( Regex . compile ( "\\q" )) { case Ok(_) => io. writeLine ( "accepted undefined escape" ) case Err(_) => io. writeLine ( "undefined escape" ) } Expected output Exit code 0
true
undefined escape
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Alternatives considered Reserve letters and numbers across all of Unicode. A changed Unicode category could change the grammar of the same pattern.Reject every non-ASCII escape. It avoids the Unicode version, but gains nothing beyond blocking a second spelling of the same letter.Why The escape namespace has a fixed boundary.
Changed rules Compile the Unicode regular expression language →
Named regex captures have one spelling Adopted November 7, 2026 · 6.0.0 · Being verified
Problem A developer needs to know which group syntax creates a named capture. Case-insensitive matching also needs a consistent Unicode rule.
Decision Use Unicode 16.0 regex syntax with simple case folding. Write a named capture as (?<name>pattern). Examples
Use one named capture spelling run · running · Verification · not-run
main.tpz Use one named capture spelling Open in Playground → import std.regex { Regex } import std.io for text in ([ "(?<word>a)" , "(?P<word>a)" ]) { match ( Regex . compile (text)) { case Ok(_) => io. writeLine ( "accepted" ) case Err(_) => io. writeLine ( "invalid pattern" ) } } Expected output Exit code 0
accepted
invalid pattern
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Apply scoped case, line, and dot flags run · running · Verification · not-run
main.tpz Apply scoped case, line, and dot flags Open in Playground → import std.regex { Regex } import std.io function show (patternText: string , text: string ) -> () { match ( Regex . compile (patternText)) { case Ok(pattern) => io. writeLine ( "{pattern. isMatch (text)}" ) case Err(_) => io. writeLine ( "compile failed" ) } } show ( "(?i:ab)" , "AB" ) show ( "(?m:^b$)" , "a\nb\nc" ) show ( "(?s:a.b)" , "a\nb" ) show ( "(?i:σ)" , "ς" ) show ( "(?i:ss)" , "ß" ) Expected output Exit code 0
true
true
true
true
false
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Use Unicode digit, word, and whitespace classes run · running · Verification · not-run
main.tpz Use Unicode digit, word, and whitespace classes Open in Playground → import std.regex { Regex } import std.io function show (patternText: string , text: string ) -> () { match ( Regex . compile (patternText)) { case Ok(pattern) => io. writeLine ( "{pattern. isMatch (text)}" ) case Err(_) => io. writeLine ( "compile failed" ) } } show ( "^\\d+$" , "١٢" ) show ( "^\\w+$" , "한" ) show ( "^\\s$" , " " ) Expected output Exit code 0
true
true
true
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Alternatives considered Accept several named capture spellings. The same named group could be written and recognized in several ways.Why The capture name always appears in the same place.
Changed rules Compile the Unicode regular expression language →
Oversized regex patterns fail at compilation Adopted November 16, 2026 · 6.0.0 · Being verified
Problem Two patterns with equal instruction counts can need different storage for captures. Deep group nesting presents a separate limit.
Decision Compilation caps instructions at 65536, program size times capture slots at 2^22 and group nesting at 128. Exceeding any cap returns Err.
Examples
A regex compiler rejects a group nesting depth of 129 run · runtime · Verification · not-run
main.tpz A regex compiler rejects a group nesting depth of 129 import std.io import std.regex { Regex } let mut left = "" let mut right = "" for i in ( 0 ..< 129 ) { left = left + "(?:" right = right + ")" } match ( Regex . compile (left + "a" + right)) { case Ok(_) => io. writeLine ( "accepted" ) case Err(_) => io. writeLine ( "nesting rejected" ) } Expected output Exit code 0
nesting rejected
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Alternatives considered Count instructions alone. That count neither limits capture storage nor controls deep nesting.Stop a search after a number of steps. The same pattern would succeed or stop depending on the input, so results would depend on input size.Why The pattern alone determines whether it fits before there is any search input.
Changed rules Compile the Unicode regular expression language →
A regex repetition does not add another empty iteration Adopted November 16, 2026 · 6.0.0 · Being verified
Problem The body of a repetition can match without consuming anything. Allowing one more empty iteration changes both the range and the capture result.
Decision Do not add an empty iteration that makes no progress. (|a)* matches byte range 0 to 1 in ab. Capture one of (a|)* on b is None.
Examples
An empty repetition makes no extra capture run · runtime · Verification · not-run
main.tpz An empty repetition makes no extra capture Open in Playground → import std.io import std.regex { Regex } match ( Regex . compile ( "(|a)*" )) { case Ok(pattern) => { match (pattern. find ( "ab" )) { case Some(found) => io. writeLine ( "{found.start}:{found.end}" ) case None() => io. writeLine ( "no match" ) } } case Err(_) => io. writeLine ( "compile failed" ) } match ( Regex . compile ( "(a|)*" )) { case Ok(pattern) => { match (pattern. find ( "b" )) { case Some(found) => { match (found.groups[ 1 ]) { case Some(group) => io. writeLine ( "captured={group}" ) case None() => io. writeLine ( "none" ) } } case None() => io. writeLine ( "no match" ) } } case Err(_) => io. writeLine ( "compile failed" ) } Expected output Exit code 0
0:1
none
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Alternatives considered Add a final empty iteration. Empty matching and empty captures would need a separate case.Why The range and the captures reflect what the repetition actually consumed.
Changed rules Search from the left and advance through nonoverlapping matches →
Search, split and replace share one match sequence Adopted November 7, 2026 · 6.0.0 · Being verified
Problem Different match ranges in search and replace make one pattern hard to reuse. Empty matches also need a way to make progress.
Decision Choose leftmost-first, nonoverlapping matches and apply the empty-match progress rule. Search, split and replace use that same sequence.
Examples
Choose the first successful alternative at the leftmost position run · running · Verification · not-run
main.tpz Choose the first successful alternative at the leftmost position Open in Playground → import std.regex { Regex } import std.io match ( Regex . compile ( "a|ab" )) { case Ok(pattern) => { match (pattern. find ( "zab" )) { case Some(found) => io. writeLine ( "{found.start}:{found.end}:{found.text}" ) case None() => io. writeLine ( "no match" ) } let present = pattern. isMatch ( "zab" ) let absent = pattern. isMatch ( "zzz" ) io. writeLine ( "{present}:{absent}" ) match (pattern. find ( "zzz" )) { case None() => io. writeLine ( "none" ) case Some(_) => io. writeLine ( "present" ) } let matches = pattern. findAll ( "zzz" ) io. writeLine ( "{matches.length}" ) } case Err(_) => io. writeLine ( "compile failed" ) } Expected output Exit code 0
1:2:a
true:false
none
0
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Return nonoverlapping matches in input order run · running · Verification · not-run
main.tpz Return nonoverlapping matches in input order Open in Playground → import std.regex { Regex } import std.io match ( Regex . compile ( "aa" )) { case Ok(pattern) => { for found in (pattern. findAll ( "aaaaa" )) { io. writeLine ( "{found.start}:{found.end}:{found.text}" ) } } case Err(_) => io. writeLine ( "compile failed" ) } Expected output Exit code 0
0:2:aa
2:4:aa
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Visit each boundary for an empty pattern and the empty input run · running · Verification · not-run
main.tpz Visit each boundary for an empty pattern and the empty input Open in Playground → import std.regex { Regex } import std.io match ( Regex . compile ( "" )) { case Ok(pattern) => { for found in (pattern. findAll ( "ab" )) { io. writeLine ( "{found.start}:{found.end}" ) } io. writeLine ( "empty input" ) for found in (pattern. findAll ( "" )) { io. writeLine ( "{found.start}:{found.end}" ) } } case Err(_) => io. writeLine ( "compile failed" ) } Expected output Exit code 0
0:0
1:1
2:2
empty input
0:0
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
run · running · Verification · not-run
main.tpz Retain empty split fields without inserting captures Open in Playground → import std.regex { Regex } import std.io match ( Regex . compile ( "(,)" )) { case Ok(pattern) => { for field in (pattern. split ( ",a,,b," )) { io. writeLine ( "[{field}]" ) } for field in (pattern. split ( "plain" )) { io. writeLine ( "[{field}]" ) } } case Err(_) => io. writeLine ( "compile failed" ) } Expected output Exit code 0
[]
[a]
[]
[b]
[]
[plain]
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
run · running · Verification · not-run
main.tpz Share the adjacent-empty-match rule across transformations Open in Playground → import std.regex { Regex } import std.io match ( Regex . compile ( "a*" )) { case Ok(pattern) => { for field in (pattern. split ( "ab" )) { io. writeLine ( "[{field}]" ) } io. writeLine (pattern. replaceAll ( "ab" , "-" )) } case Err(_) => io. writeLine ( "compile failed" ) } Expected output Exit code 0
[]
[b]
[]
-b-
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Alternatives considered Choose different matching rules for each API. Search could report a range that replacement would not select.Why The same pattern selects predictable ranges across operations.
Changed rules Search from the left and advance through nonoverlapping matches →Split and replace using the shared match sequence →
Regex matches report UTF-8 byte offsets Adopted November 7, 2026 · 6.0.0 · Being verified
Problem A multibyte character makes scalar indices and byte offsets diverge. Extracting a match requires knowing which unit the positions use.
Decision Match. start and Match. end are UTF-8 byte offsets. Start is inclusive and end is exclusive.
Examples
Report UTF-8 byte offsets for non-ASCII matches run · running · Verification · not-run
main.tpz Report UTF-8 byte offsets for non-ASCII matches Open in Playground → import std.regex { Regex } import std.io function show (patternText: string , text: string ) -> () { match ( Regex . compile (patternText)) { case Ok(pattern) => { match (pattern. find (text)) { case Some(found) => io. writeLine ( "{found.start}:{found.end}:{found.text}" ) case None() => io. writeLine ( "no match" ) } } case Err(_) => io. writeLine ( "compile failed" ) } } show ( "한" , "é한🙂" ) show ( "́" , "éx" ) Expected output Exit code 0
2:5:한
1:3:́
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Recover a match through the byte slice identified by its offsets run · running · Verification · not-run
main.tpz Recover a match through the byte slice identified by its offsets Open in Playground → import std.regex { Regex } import std.io let text = "한x" match ( Regex . compile ( "한" )) { case Ok(pattern) => { match (pattern. find (text)) { case Some(found) => { let bytes = text. encodeUtf8 (). slice (found.start, found.end) match (bytes. decodeUtf8 ()) { case Ok(decoded) => io. writeLine (decoded) case Err(_) => io. writeLine ( "invalid UTF-8 slice" ) } } case None() => io. writeLine ( "no match" ) } } case Err(_) => io. writeLine ( "compile failed" ) } Expected output Exit code 0
한
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Alternatives considered Return Unicode scalar indices. Getting the encoded byte range would require a separate position conversion.Why The same offsets identify the matched range in the encoded input.
Changed rules Read match boundaries and capture snapshots →
Regex replacements use braces for capture references Adopted November 7, 2026 · 6.0.0 · Being verified
Problem A replacement may combine matched fragments with literal dollar signs. Its syntax needs to show where a capture name or number ends.
Decision Capture zero is the entire match. Use braces for capture references and $$ for a literal dollar sign in a replacement. Examples
Keep capture zero and distinguish missing and empty captures run · running · Verification · not-run
main.tpz Keep capture zero and distinguish missing and empty captures Open in Playground → import std.regex { Regex } import std.io match ( Regex . compile ( "(?<word>a)(b)?()" )) { case Ok(pattern) => { match (pattern. find ( "a" )) { case Some(found) => { io. writeLine ( "{found.groups.length}" ) for group in (found.groups) { match (group) { case Some(text) => io. writeLine ( "some={text}" ) case None() => io. writeLine ( "none" ) } } } case None() => io. writeLine ( "no match" ) } } case Err(_) => io. writeLine ( "compile failed" ) } Expected output Exit code 0
4
some=a
some=a
none
some=
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
run · running · Verification · not-run
main.tpz Expand braced capture references and a literal dollar Open in Playground → import std.regex { Regex } import std.io match ( Regex . compile ( "(?<word>[a-z]+)([0-9]+)?" )) { case Ok(pattern) => { let replacement = "$\{word\}/$\{0\}/$\{2\}/$\{missing\}/$$" io. writeLine (pattern. replaceAll ( "a1 b" , replacement)) io. writeLine (pattern. replaceAll ( "123" , replacement)) } case Err(_) => io. writeLine ( "compile failed" ) } Expected output Exit code 0
a/a1/1//$ b/b///$
123
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
run · running · Verification · not-run
main.tpz Preserve text that is not a braced reference Open in Playground → import std.regex { Regex } import std.io match ( Regex . compile ( "a" )) { case Ok(pattern) => io. writeLine (pattern. replaceAll ( "a" , "$word $1 $ $\{\} $\{bad-name\}" )) case Err(_) => io. writeLine ( "compile failed" ) } Expected output Exit code 0
$word $1 $ ${} ${bad-name}
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout $word $1 $ ${} ${bad-name} This exact example has not been executed.
Alternatives considered Also accept bare $1. That would give the same reference two spellings.Why The replacement shows which text is a capture and which dollar signs are literal.
Changed rules Read match boundaries and capture snapshots →Split and replace using the shared match sequence →
URL operations follow WHATWG Adopted November 7, 2026 · 6.0.0 · Being verified
Problem Parsers can normalize the same URL differently depending on their standard. Query strings encoded as form data also need a decoding rule.
Decision Parse and serialize absolute URLs under WHATWG without a base URL. Decode query fields using form-urlencoding rules. Examples
Normalize the scheme, host, port, and path run · running · Verification · not-run
main.tpz Normalize the scheme, host, port, and path Open in Playground → import std.url { URL } import std.io match ( URL . parse ( "HTTPS://Example.COM:443/a/./b/../c?x=1#part" )) { case Ok(value) => io. writeLine (value. toString ()) case Err(_) => io. writeLine ( "parse failed" ) } Expected output Exit code 0
https://example.com/a/c?x=1#part
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout https://example.com/a/c?x=1#part This exact example has not been executed.
Handle invalid absolute URL text as data run · running · Verification · not-run
main.tpz Handle invalid absolute URL text as data Open in Playground → import std.url { URL } import std.io for text in ([ "" , "../guide" , "1bad:x" , "https://" , "https://example.com:wrong" ]) { match ( URL . parse (text)) { case Err(message) => io. writeLine ( "{message != ""}" ) case Ok(_) => io. writeLine ( "accepted" ) } } Expected output Exit code 0
true
true
true
true
true
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Preserve serialized escapes and empty components through parsing run · running · Verification · not-run
main.tpz Preserve serialized escapes and empty components through parsing Open in Playground → import std.url { URL } import std.io for text in ([ "https://example.com/a%2fb?x=%2b#p%2fq" , "https://example.com/?#" ]) { match ( URL . parse (text)) { case Ok(value) => { io. writeLine (value. toString ()) match ( URL . parse (value. toString ())) { case Ok(again) => io. writeLine (again. toString ()) case Err(_) => io. writeLine ( "second parse failed" ) } } case Err(_) => io. writeLine ( "first parse failed" ) } } Expected output Exit code 0
https://example.com/a%2fb?x=%2b#p%2fq
https://example.com/a%2fb?x=%2b#p%2fq
https://example.com/?#
https://example.com/?#
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout https://example.com/a%2fb?x=%2b#p%2fq https://example.com/a%2fb?x=%2b#p%2fq https://example.com/?# https://example.com/?# This exact example has not been executed.
Decode repeated query fields and preserve their value order run · running · Verification · not-run
main.tpz Decode repeated query fields and preserve their value order Open in Playground → import std.url { URL } import std.io match ( URL . parse ( "https://example.com/?q=a+b&q=%ED%95%9C&empty&x=a=b&=blank" )) { case Ok(value) => { let fields = value. query () for name in ([ "q" , "empty" , "x" , "" ]) { match (fields. get (name)) { case Some(values) => { for item in (values) { io. writeLine ( "{name}={item}" ) } } case None() => io. writeLine ( "missing" ) } } } case Err(_) => io. writeLine ( "parse failed" ) } Expected output Exit code 0
q=a b
q=한
empty=
x=a=b
=blank
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout q=a b q=한 empty= x=a=b =blank This exact example has not been executed.
run · running · Verification · not-run
main.tpz Keep malformed percent escapes as query data Open in Playground → import std.url { URL } import std.io for text in ([ "https://example.com/?x=%" , "https://example.com/?x=%GG" ]) { match ( URL . parse (text)) { case Ok(value) => { match (value. query (). get ( "x" )) { case Some(values) => io. writeLine (values[ 0 ]) case None() => io. writeLine ( "missing" ) } } case Err(_) => io. writeLine ( "parse failed" ) } } Expected output Exit code 0
%
%GG
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Alternatives considered Implement RFC 3986 directly. That would give URL and form query behavior different from the chosen WHATWG contract.Why A single contract covers absolute URLs and form query fields.
Changed rules Parse and serialize absolute URLs →Decode query fields into an independent map →
Internationalized domains use Unicode 16.0.0 Adopted November 16, 2026 · 6.0.0 · Being verified
Problem Installed Unicode versions can differ by environment. Depending on host tables could classify the same domain differently.
Decision UTS 46 processing uses the Unicode 16.0.0 tables. Lexing, normalization, and regular expression properties use the same 16.0.0 source data. Examples
URL parsing folds the Cyrillic letter introduced in Unicode 16 run · runtime · Verification · not-run
main.tpz URL parsing folds the Cyrillic letter introduced in Unicode 16 Open in Playground → import std.io import std.test import std.url { URL } for input in ([ "https://.example" , "https://.example" ]) { let url = test. assertOk ( URL . parse (input)) io. writeLine (test. assertSome (url. host ())) } Expected output Exit code 0
xn--d4f.example
xn--d4f.example
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout xn--d4f.example xn--d4f.example This exact example has not been executed.
Alternatives considered Use the host’s newest tables or give domain processing its own Unicode version. Results could vary by environment, or a character could be classified differently in URLs and names.Why Internationalized domains use the same Unicode version across environments.
Changed rules Read serialized URL components and their absence →
Civil dates range from year 1 through year 9999 Adopted November 7, 2026 · 6.0.0 · Being verified
Problem Accepting year zero changes what dates can be stored and exchanged. Date arithmetic can also cross the supported limits.
Decision Use the proleptic Gregorian range 0001- 01- 01 through 9999- 12- 31. Reject year zero. Day arithmetic beyond this range produces TPZ4004 at runtime. Examples
Reject year zero during component construction run · running · Verification · not-run
main.tpz Reject year zero during component construction Open in Playground → import std.date { Date } import std.io match ( Date . fromYmd ( 0 , 1 , 1 )) { case Err(_) => io. writeLine ( "year zero rejected" ) case Ok(_) => io. writeLine ( "accepted" ) } Expected output Exit code 0
year zero rejected
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Reject year zero in ISO text run · running · Verification · not-run
main.tpz Reject year zero in ISO text Open in Playground → import std.date { Date } import std.io match ( Date . parseIso ( "0000-01-01" )) { case Err(_) => io. writeLine ( "year zero rejected" ) case Ok(_) => io. writeLine ( "accepted" ) } Expected output Exit code 0
year zero rejected
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Cross leap days, years, and the full supported interval run · running · Verification · not-run
main.tpz Cross leap days, years, and the full supported interval Open in Playground → import std.date { Date } import std.test import std.io let leap = test. assertOk ( Date . fromYmd ( 2000 , 2 , 28 )) io. writeLine (leap. addDays ( 1 ). toIso ()) io. writeLine (leap. addDays ( 2 ). toIso ()) io. writeLine (leap. toIso ()) io. writeLine (test. assertOk ( Date . fromYmd ( 1900 , 2 , 28 )). addDays ( 1 ). toIso ()) io. writeLine (test. assertOk ( Date . fromYmd ( 1582 , 10 , 4 )). addDays ( 1 ). toIso ()) io. writeLine (test. assertOk ( Date . fromYmd ( 2000 , 1 , 1 )). addDays ( - 1 ). toIso ()) io. writeLine (leap. addDays ( 0 ). toIso ()) io. writeLine (test. assertOk ( Date . fromYmd ( 1 , 1 , 1 )). addDays ( 3652058 ). toIso ()) io. writeLine (test. assertOk ( Date . fromYmd ( 9999 , 12 , 31 )). addDays ( - 3652058 ). toIso ()) Expected output Exit code 0
2000-02-29
2000-03-01
2000-02-28
1900-03-01
1582-10-05
1999-12-31
2000-02-28
9999-12-31
0001-01-01
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout 2000-02-29 2000-03-01 2000-02-28 1900-03-01 1582-10-05 1999-12-31 2000-02-28 9999-12-31 0001-01-01 This exact example has not been executed.
Reject the day after the final supported date run · running · Verification · not-run
main.tpz Reject the day after the final supported date Open in Playground → import std.date { Date } import std.test import std.io let date = test. assertOk ( Date . fromYmd ( 9999 , 12 , 31 )) date. addDays ( 1 ) io. writeLine ( "after" ) Expected output Nonzero exit
No stdout. Expected result Expected result Rejection during run. Nonzero exit.
No stdout.
This exact example has not been executed.
Reject the day before the first supported date run · running · Verification · not-run
main.tpz Reject the day before the first supported date Open in Playground → import std.date { Date } import std.test import std.io let date = test. assertOk ( Date . fromYmd ( 1 , 1 , 1 )) date. addDays ( - 1 ) io. writeLine ( "after" ) Expected output Nonzero exit
No stdout. Expected result Expected result Rejection during run. Nonzero exit.
No stdout.
This exact example has not been executed.
Alternatives considered Continue accepting year zero. It would change the lower boundary of accepted dates.Why The range of representable dates is known before doing arithmetic.
Changed rules Construct valid Gregorian civil dates →Add whole calendar days within the civil date range →
Big integer text uses an explicit radix and lowercase digits Adopted November 7, 2026 · 6.0.0 · Being verified
Problem Accepting spaces and capital letters makes it harder to tell whether text follows the intended format. A prefix could also change how the input is interpreted.
Decision Use radix 2 through 36 and lowercase ASCII digits. A single leading minus sign is allowed. Keep whitespace significant and do not infer a radix from a prefix. Examples
Parse and format exact integers in explicit radices run · running · Verification · not-run
main.tpz Parse and format exact integers in explicit radices Open in Playground → import std.bigint { BigInt } import std.test import std.io let number = test. assertSome ( BigInt . parse ( "ff" , 16 )) io. writeLine (number. toString ( 2 )) io. writeLine (number. toString ( 10 )) io. writeLine (number. toString ( 16 )) io. writeLine (test. assertSome ( BigInt . parse ( "z" , 36 )). toString ( 10 )) io. writeLine (test. assertSome ( BigInt . parse ( "-00015" , 10 )). toString ( 16 )) io. writeLine (test. assertSome ( BigInt . parse ( "-000" , 10 )). toString ( 36 )) io. writeLine (test. assertSome ( BigInt . parse ( "123456789012345678901234567890" , 10 )). toString ( 10 )) Expected output Exit code 0
11111111
255
ff
35
-f
0
123456789012345678901234567890
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout 11111111 255 ff 35 -f 0 123456789012345678901234567890 This exact example has not been executed.
Reject surrounding whitespace in integer text run · running · Verification · not-run
main.tpz Reject surrounding whitespace in integer text Open in Playground → import std.bigint { BigInt } import std.io match ( BigInt . parse ( " 10 " , 10 )) { case None() => io. writeLine ( "whitespace rejected" ) case Some(_) => io. writeLine ( "accepted" ) } Expected output Exit code 0
whitespace rejected
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Reject a leading plus sign in integer text run · running · Verification · not-run
main.tpz Reject a leading plus sign in integer text Open in Playground → import std.bigint { BigInt } import std.io match ( BigInt . parse ( "+10" , 10 )) { case None() => io. writeLine ( "plus rejected" ) case Some(_) => io. writeLine ( "accepted" ) } Expected output Exit code 0
plus rejected
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Reject uppercase letters in integer text run · running · Verification · not-run
main.tpz Reject uppercase letters in integer text Open in Playground → import std.bigint { BigInt } import std.io match ( BigInt . parse ( "FF" , 16 )) { case None() => io. writeLine ( "uppercase rejected" ) case Some(_) => io. writeLine ( "accepted" ) } Expected output Exit code 0
uppercase rejected
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Alternatives considered Accept whitespace, plus signs and uppercase letters. The same value would have additional noncanonical spellings.Why The requested radix and the literal digits determine the number.
Changed rules Read and write integers in an explicit radix →
Decimal multiplication checks the normalized result scale Adopted November 8, 2026 · 6.0.0 · Being verified
Problem Two values can have a large combined scale while their product fits after removing zeros. Checking the sum first would reject that product.
Decision Use an arbitrary-precision integer coefficient and normalized scale from 0 through 4294967295. Arithmetic is exact and decimal output has one canonical spelling. Normalize a product before checking whether its scale fits. Examples
Normalize signs and redundant decimal zeros run · running · Verification · not-run
main.tpz Normalize signs and redundant decimal zeros Open in Playground → import std.decimal { Decimal } import std.test import std.io function read (text: string ) -> Decimal { let parsed: Option < Decimal > = Decimal . parse (text) let value: Decimal = test. assertSome (parsed) return value } for text in ([ "0" , "-0.000" , "+00012.3400" , ".0050" , "100.000" ]) { let value: Decimal = read (text) io. writeLine ( "{value. toString ()} {value. scale ()}" ) let reparsed: Option < Decimal > = Decimal . parse (value. toString ()) let recovered: Decimal = test. assertSome (reparsed) test. assertEq (recovered, value) } Expected output Exit code 0
0 0
0 0
12.34 2
0.005 3
100 0
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout 0 0 0 0 12.34 2 0.005 3 100 0 This exact example has not been executed.
Keep every digit beyond machine integer precision run · running · Verification · not-run
main.tpz Keep every digit beyond machine integer precision Open in Playground → import std.decimal { Decimal } import std.test import std.io function read (text: string ) -> Decimal { let parsed: Option < Decimal > = Decimal . parse (text) let value: Decimal = test. assertSome (parsed) return value } let left: Decimal = read ( "1000000000000000000000000000000.25" ) let right: Decimal = read ( "0.75" ) let sum: Decimal = left + right let difference: Decimal = left - right let product: Decimal = left * right io. writeLine (sum. toString ()) io. writeLine (difference. toString ()) io. writeLine (product. toString ()) io. writeLine (left. toString ()) Expected output Exit code 0
1000000000000000000000000000001
999999999999999999999999999999.5
750000000000000000000000000000.1875
1000000000000000000000000000000.25
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout 1000000000000000000000000000001 999999999999999999999999999999.5 750000000000000000000000000000.1875 1000000000000000000000000000000.25 This exact example has not been executed.
Normalize a product before checking its final scale run · running · Verification · not-run
main.tpz Normalize a product before checking its final scale Open in Playground → import std.decimal { Decimal } import std.test import std.io let parsedPlace: Option < Decimal > = Decimal . parse ( "0.1" ) let mut place: Decimal = test. assertSome (parsedPlace) let mut smallest: Decimal = ( 1 ). toDecimal () let mut step: int = 0 while (step < 32 ) { smallest = smallest * place if (step < 31 ) { place = place * place } step = step + 1 } let doubled: Decimal = smallest * ( 2 ). toDecimal () let parsedHalf: Option < Decimal > = Decimal . parse ( "0.5" ) let half: Decimal = test. assertSome (parsedHalf) let recovered: Decimal = doubled * half let equal = recovered == smallest io. writeLine ( "{recovered. scale ()} {equal}" ) Expected output Exit code 0
4294967295 true
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Alternatives considered Limit the intermediate sum of scales first. A result can fit after normalization and still be rejected.Why Representability follows the result rather than a temporary calculation.
Changed rules Preserve exact decimal values and canonical scale →
Decimal parsing checks the entire ASCII input Adopted November 8, 2026 · 6.0.0 · Being verified
Problem Silently accepting whitespace or exponents can make it hard to tell which text became the value. Accepted spellings need a clear boundary.
Decision Parse a complete ASCII decimal. Accept a sign and . 5. Reject 1., whitespace, exponents, separators, radix prefixes and non-ASCII digits.
Examples
Accept explicit signs and fractional decimal text run · running · Verification · not-run
main.tpz Accept explicit signs and fractional decimal text Open in Playground → import std.decimal { Decimal } import std.test import std.io function read (text: string ) -> Decimal { let parsed: Option < Decimal > = Decimal . parse (text) let value: Decimal = test. assertSome (parsed) return value } for text in ([ "7" , "+7" , "-7" , "0007" , ".5" , "-.5" , "+.5" , "01.0200" ]) { let value: Decimal = read (text) io. writeLine (value. toString ()) } Expected output Exit code 0
7
7
-7
7
0.5
-0.5
0.5
1.02
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Reject incomplete and nondecimal spellings run · running · Verification · not-run
main.tpz Reject incomplete and nondecimal spellings Open in Playground → import std.decimal { Decimal } import std.io for text in ([ "" , "+" , "-" , "." , "+." , "-." , "1." , "1.2.3" , "1e2" , "1E+2" , "0x10" , "1_000" , "1,2" , "NaN" , "Infinity" , " 1" , "1 " , "1.2" , "١.٢" , "1\n2" , "\t1" ]) { match ( Decimal . parse (text)) { case None() => io. writeLine ( "rejected" ) case Some(_) => io. writeLine ( "accepted" ) } } Expected output Exit code 0
rejected
rejected
rejected
rejected
rejected
rejected
rejected
rejected
rejected
rejected
rejected
rejected
rejected
rejected
rejected
rejected
rejected
rejected
rejected
rejected
rejected
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout rejected rejected rejected rejected rejected rejected rejected rejected rejected rejected rejected rejected rejected rejected rejected rejected rejected rejected rejected rejected rejected This exact example has not been executed.
Alternatives considered Use a permissive input grammar. Extra characters would require separate interpretations.Why The caller can tell from the spelling whether text is a decimal.
Changed rules Parse complete finite decimal text →
Decimal rounding names its direction and tie rule Adopted November 8, 2026 · 6.0.0 · Being verified
Problem Floor, ceiling and rounding toward zero can happen to agree on one number. The name should tell readers which intent survives different input.
Decision Provide six rounding modes. Use Half Even by default and define direction and ties for either sign.
Examples
Resolve positive and negative ties in every rounding mode run · running · Verification · not-run
main.tpz Resolve positive and negative ties in every rounding mode Open in Playground → import std.decimal { Decimal , RoundingMode } import std.test import std.io function read (text: string ) -> Decimal { let parsed: Option < Decimal > = Decimal . parse (text) let value: Decimal = test. assertSome (parsed) return value } function rounded (text: string , mode: RoundingMode ) -> string { let value: Decimal = read (text) return value. round ( 0 , mode). toString () } let modes: Array < RoundingMode > = [ RoundingMode . Down (), RoundingMode . Up (), RoundingMode . TowardZero (), RoundingMode . AwayFromZero (), RoundingMode . HalfUp (), RoundingMode . HalfEven ()] for mode in (modes) { let a = rounded ( "2.5" , mode) let b = rounded ( "3.5" , mode) let c = rounded ( "-2.5" , mode) let d = rounded ( "-3.5" , mode) io. writeLine ( "{a} {b} {c} {d}" ) } Expected output Exit code 0
2 3 -3 -4
3 4 -2 -3
2 3 -2 -3
3 4 -3 -4
3 4 -3 -4
2 4 -2 -4
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout 2 3 -3 -4 3 4 -2 -3 2 3 -2 -3 3 4 -3 -4 3 4 -3 -4 2 4 -2 -4 This exact example has not been executed.
Distinguish directed rounding from nearest rounding run · running · Verification · not-run
main.tpz Distinguish directed rounding from nearest rounding Open in Playground → import std.decimal { Decimal , RoundingMode } import std.test import std.io function read (text: string ) -> Decimal { let parsed: Option < Decimal > = Decimal . parse (text) let value: Decimal = test. assertSome (parsed) return value } function rounded (text: string , mode: RoundingMode ) -> string { let value: Decimal = read (text) return value. round ( 0 , mode). toString () } let modes: Array < RoundingMode > = [ RoundingMode . Down (), RoundingMode . Up (), RoundingMode . TowardZero (), RoundingMode . AwayFromZero (), RoundingMode . HalfUp (), RoundingMode . HalfEven ()] for mode in (modes) { let a = rounded ( "2.1" , mode) let b = rounded ( "2.9" , mode) let c = rounded ( "-2.1" , mode) let d = rounded ( "-2.9" , mode) io. writeLine ( "{a} {b} {c} {d}" ) } Expected output Exit code 0
2 2 -3 -3
3 3 -2 -2
2 2 -2 -2
3 3 -3 -3
2 3 -2 -3
2 3 -2 -3
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout 2 2 -3 -3 3 3 -2 -2 2 2 -2 -2 3 3 -3 -3 2 3 -2 -3 2 3 -2 -3 This exact example has not been executed.
Apply the default mode and normalize a carry or zero run · running · Verification · not-run
main.tpz Apply the default mode and normalize a carry or zero Open in Playground → import std.decimal { Decimal } import std.test import std.io function read (text: string ) -> Decimal { let parsed: Option < Decimal > = Decimal . parse (text) let value: Decimal = test. assertSome (parsed) return value } let value: Decimal = read ( "1.245" ) io. writeLine (value. round ( 2 ). toString ()) io. writeLine ( read ( "1.255" ). round ( 2 ). toString ()) io. writeLine (value. round ( 5 ). toString ()) let carry: Decimal = read ( "9.995" ). round ( 2 ) let zero: Decimal = read ( "-0.004" ). round ( 2 ) io. writeLine ( "{carry. toString ()} {carry. scale ()}" ) io. writeLine ( "{zero. toString ()} {zero. scale ()}" ) io. writeLine (value. toString ()) Expected output Exit code 0
1.24
1.26
1.245
10 0
0 0
1.245
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout 1.24 1.26 1.245 10 0 0 0 1.245 This exact example has not been executed.
Alternatives considered Merge modes that produce the same result in some cases. Floor, ceiling, toward zero and nearest express different intents.Why The rounding intent remains visible when inputs change.
Changed rules Choose a decimal grid and a rounding direction →
Decimal division rounds the exact quotient once Adopted November 8, 2026 · 6.0.0 · Being verified
Problem Intermediate rounding can move the final result at the requested precision. An internal scale sum could also reject an exact zero.
Decision Round the exact quotient once at the requested scale. Do not reject a zero quotient because of an intermediate scale sum. Division by zero returns Err. An invalid scale produces TPZ5001 at runtime. Examples
Distinguish exact and repeating quotients at the requested grid run · running · Verification · not-run
main.tpz Distinguish exact and repeating quotients at the requested grid Open in Playground → import std.decimal { Decimal } import std.test import std.io function show (result: Result < Decimal , string > ) -> () { let value: Decimal = test. assertOk (result) io. writeLine ( "{value. toString ()} {value. scale ()}" ) } let one: Decimal = ( 1 ). toDecimal () let third: Result < Decimal , string > = one. div (( 3 ). toDecimal (), 6 ) let eighth: Result < Decimal , string > = one. div (( 8 ). toDecimal (), 2 ) let negativeTie: Result < Decimal , string > = ( - 1 ). toDecimal (). div (( 8 ). toDecimal (), 2 ) let exact: Result < Decimal , string > = ( 100 ). toDecimal (). div (( 4 ). toDecimal (), 4 ) let integerGrid: Result < Decimal , string > = ( 2 ). toDecimal (). div (( 3 ). toDecimal (), 0 ) show (third) show (eighth) show (negativeTie) show (exact) show (integerGrid) Expected output Exit code 0
0.333333 6
0.12 2
-0.12 2
25 0
1 0
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout 0.333333 6 0.12 2 -0.12 2 25 0 1 0 This exact example has not been executed.
Apply every rounding mode to signed quotient ties run · running · Verification · not-run
main.tpz Apply every rounding mode to signed quotient ties Open in Playground → import std.decimal { Decimal , RoundingMode } import std.test import std.io function read (text: string ) -> Decimal { let parsed: Option < Decimal > = Decimal . parse (text) let value: Decimal = test. assertSome (parsed) return value } function quotient (text: string , mode: RoundingMode ) -> string { let value: Decimal = read (text) let result: Result < Decimal , string > = value. div (( 2 ). toDecimal (), 0 , mode) let rounded: Decimal = test. assertOk (result) return rounded. toString () } let modes: Array < RoundingMode > = [ RoundingMode . Down (), RoundingMode . Up (), RoundingMode . TowardZero (), RoundingMode . AwayFromZero (), RoundingMode . HalfUp (), RoundingMode . HalfEven ()] for mode in (modes) { let a = quotient ( "5" , mode) let b = quotient ( "7" , mode) let c = quotient ( "-5" , mode) let d = quotient ( "-7" , mode) io. writeLine ( "{a} {b} {c} {d}" ) } Expected output Exit code 0
2 3 -3 -4
3 4 -2 -3
2 3 -2 -3
3 4 -3 -4
3 4 -3 -4
2 4 -2 -4
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout 2 3 -3 -4 3 4 -2 -3 2 3 -2 -3 3 4 -3 -4 3 4 -3 -4 2 4 -2 -4 This exact example has not been executed.
Return a recoverable error for every zero divisor run · running · Verification · not-run
main.tpz Return a recoverable error for every zero divisor Open in Playground → import std.decimal { Decimal } import std.test import std.io function read (text: string ) -> Decimal { let parsed: Option < Decimal > = Decimal . parse (text) let value: Decimal = test. assertSome (parsed) return value } let divisor: Decimal = read ( "-0.000" ) let numerators: Array < Decimal > = [( 0 ). toDecimal (), ( 1 ). toDecimal ()] for numerator in (numerators) { let result: Result < Decimal , string > = numerator. div (divisor, 2 ) match (result) { case Err(message) => io. writeLine (message) case Ok(_) => io. writeLine ( "accepted" ) } } io. writeLine (divisor. toString ()) Expected output Exit code 0
Decimal.div: division by zero
Decimal.div: division by zero
0
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout Decimal.div: division by zero Decimal.div: division by zero 0 This exact example has not been executed.
Keep a zero quotient at the largest valid scale run · running · Verification · not-run
main.tpz Keep a zero quotient at the largest valid scale Open in Playground → import std.decimal { Decimal } import std.test import std.io function read (text: string ) -> Decimal { let parsed: Option < Decimal > = Decimal . parse (text) let value: Decimal = test. assertSome (parsed) return value } let divisor: Decimal = read ( "0.1" ) let result: Result < Decimal , string > = ( 0 ). toDecimal (). div (divisor, 4294967295 ) match (result) { case Ok(value) => io. writeLine (value. toString ()) case Err(_) => io. writeLine ( "unexpected error" ) } Expected output Exit code 0
0
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Reject an invalid scale before classifying a zero divisor run · running · Verification · not-run
main.tpz Reject an invalid scale before classifying a zero divisor Open in Playground → import std.decimal { Decimal } import std.io let value: Decimal = ( 1 ). toDecimal () value. div (( 0 ). toDecimal (), - 1 ) io. writeLine ( "after" ) Expected output Nonzero exit
No stdout. Expected result Expected result Rejection during run. Nonzero exit.
No stdout.
This exact example has not been executed.
Reject an invalid scale before classifying a zero divisor run · running · Verification · not-run
main.tpz Reject an invalid scale before classifying a zero divisor Open in Playground → import std.decimal { Decimal } import std.io let value: Decimal = ( 1 ). toDecimal () value. div (( 0 ). toDecimal (), 4294967296 ) io. writeLine ( "after" ) Expected output Nonzero exit
No stdout. Expected result Expected result Rejection during run. Nonzero exit.
No stdout.
This exact example has not been executed.
Alternatives considered Limit the sum of intermediate scales first. The operation could be rejected even when its result is representable zero.Why The requested scale and rounding mode determine the quotient.
Changed rules Divide with an explicit result scale →
Decimal to integer conversion succeeds only for an exact result Adopted November 8, 2026 · 6.0.0 · Being verified
Problem Converting a fraction to an integer can lose information. An integral value can also be too large for the destination.
Decision int. to Decimal is exact. to Int returns None() for a fractional value or overflow.There is no implicit conversion. Exchange values with Big Int explicitly through the decimal text API. Examples
Convert both int endpoints and reject fractions or overflow run · running · Verification · not-run
main.tpz Convert both int endpoints and reject fractions or overflow Open in Playground → import std.decimal { Decimal } import std.test import std.io function read (text: string ) -> Decimal { let parsed: Option < Decimal > = Decimal . parse (text) let value: Decimal = test. assertSome (parsed) return value } for text in ([ "-9223372036854775808" , "9223372036854775807" , "-9223372036854775809" , "9223372036854775808" , "1.000" , "1.001" , "-1.001" , "-0.000" ]) { let value: Decimal = read (text) match (value. toInt ()) { case Some(integer) => io. writeLine ( "{integer}" ) case None() => io. writeLine ( "not an int" ) } } let large: Decimal = read ( "1000000000000000000000000000000" ) let narrowed: Option < int > = large. toInt () test. assertNone (narrowed) io. writeLine (large. toString ()) Expected output Exit code 0
-9223372036854775808
9223372036854775807
not an int
not an int
1
not an int
not an int
0
1000000000000000000000000000000
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout -9223372036854775808 9223372036854775807 not an int not an int 1 not an int not an int 0 1000000000000000000000000000000 This exact example has not been executed.
Convert int values to exact scale zero decimals run · running · Verification · not-run
main.tpz Convert int values to exact scale zero decimals Open in Playground → import std.decimal { Decimal } import std.test import std.io let integers: Array < int > = [ - 9223372036854775807 - 1 , - 1 , 0 , 1 , 9223372036854775807 ] for integer in (integers) { let value: Decimal = integer. toDecimal () let narrowed: Option < int > = value. toInt () let recovered: int = test. assertSome (narrowed) test. assertEq (recovered, integer) io. writeLine ( "{value. toString ()} {value. scale ()}" ) } Expected output Exit code 0
-9223372036854775808 0
-1 0
0 0
1 0
9223372036854775807 0
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout -9223372036854775808 0 -1 0 0 0 1 0 9223372036854775807 0 This exact example has not been executed.
Exchange arbitrary precision integers through explicit decimal text run · running · Verification · not-run
main.tpz Exchange arbitrary precision integers through explicit decimal text Open in Playground → import std.decimal { Decimal } import std.bigint { BigInt } import std.test import std.io let parsedInteger: Option < BigInt > = BigInt . parse ( "123456789012345678901234567890" , 10 ) let integer: BigInt = test. assertSome (parsedInteger) let parsedDecimal: Option < Decimal > = Decimal . parse (integer. toString ( 10 )) let value: Decimal = test. assertSome (parsedDecimal) io. writeLine (value. toString ()) let parsedAgain: Option < BigInt > = BigInt . parse (value. toString (), 10 ) let recovered: BigInt = test. assertSome (parsedAgain) let equal = recovered == integer io. writeLine ( "{equal}" ) let parsedFraction: Option < Decimal > = Decimal . parse ( "1.5" ) let fraction: Decimal = test. assertSome (parsedFraction) let integral: Option < BigInt > = BigInt . parse (fraction. toString (), 10 ) match (integral) { case None() => io. writeLine ( "fraction rejected" ) case Some(_) => io. writeLine ( "converted" ) } Expected output Exit code 0
123456789012345678901234567890
true
fraction rejected
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout 123456789012345678901234567890 true fraction rejected This exact example has not been executed.
Alternatives considered Convert mixed values implicitly and truncate fractions. A conversion could discard precision without showing it at the call site.Why Callers can handle fractions and overflow explicitly.
Changed rules Convert numeric values explicitly and without truncation →
Decimal comparisons use exact numerical values Adopted November 8, 2026 · 6.0.0 · Being verified
Problem 1. 0 and 1. 00 have different spellings but the same value. Including scale would change how equality and sorting work.
Decision Compare exact numerical values. Padding and signed zero do not matter, and comparison does not convert to binary floating point.
Examples
Treat values with different input padding as equal run · running · Verification · not-run
main.tpz Treat values with different input padding as equal Open in Playground → import std.decimal { Decimal } import std.test import std.io function read (text: string ) -> Decimal { let parsed: Option < Decimal > = Decimal . parse (text) let value: Decimal = test. assertSome (parsed) return value } let left: Decimal = read ( "1.20" ) let right: Decimal = read ( "1.2000" ) let equal = left == right let unequal = left != right let less = left < right let lessOrEqual = left <= right let greater = left > right let greaterOrEqual = left >= right io. writeLine ( "{equal} {unequal} {less} {lessOrEqual} {greater} {greaterOrEqual}" ) io. writeLine ( "{left. scale ()} {right. scale ()}" ) Expected output Exit code 0
true false false true false true
1 1
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout true false false true false true 1 1 This exact example has not been executed.
Order neighboring large values and signed zero exactly run · running · Verification · not-run
main.tpz Order neighboring large values and signed zero exactly Open in Playground → import std.decimal { Decimal } import std.test import std.io function read (text: string ) -> Decimal { let parsed: Option < Decimal > = Decimal . parse (text) let value: Decimal = test. assertSome (parsed) return value } let lower: Decimal = read ( "9007199254740992" ) let higher: Decimal = read ( "9007199254740993" ) let increasing = lower < higher let decreasing = higher > lower let distinct = lower != higher let negativeOrder = - higher < - lower io. writeLine ( "{increasing} {decreasing} {distinct} {negativeOrder}" ) let negativeZero: Decimal = read ( "-0.000" ) let zero: Decimal = ( 0 ). toDecimal () let sameZero = negativeZero == zero io. writeLine ( "{sameZero}" ) Expected output Exit code 0
true true true true
true
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Alternatives considered Require equal scales for equality. The same number could compare differently depending on its input spelling.Why Equality and order are useful independently of the input format.
Changed rules Compare exact decimal values independently of input scale →
Filesystem functions preserve bytes and sort directory entries Adopted November 7, 2026 · 6.0.0 · Being verified
Problem Programs read exact bytes or compare directory listings across systems. On failure, the caller also needs to identify the path involved.
Decision Byte operations preserve the bytes exactly. Text operations decode strict UTF-8. Directory listings sort immediate entries and reject names that cannot be represented as Unicode. Host errors include the operation and path. Examples
Preserve a byte order mark and physical line endings run · running · Verification · not-run
main.tpz Preserve a byte order mark and physical line endings import std.fs import std.test import std.io io. writeLine (test. assertOk (fs. readText ( "source.txt" ))) Expected output Exit code 0
alpha
한글
source.txt Preserve a byte order mark and physical line endings Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Preserve raw bytes and reject invalid UTF-8 text run · running · Verification · not-run
main.tpz Preserve raw bytes and reject invalid UTF-8 text import std.fs import std.bytes { Bytes } import std.test import std.io let bytes = test. assertOk ( Bytes . fromArray ([ 0 , 65 , 255 ])) test. assertOk (fs. writeBytes ( "data.bin" , bytes)) io. writeLine (test. assertOk (fs. readBytes ( "data.bin" )). toHex ()) test. assertErr (fs. readText ( "data.bin" )) io. writeLine ( "invalid text rejected" ) test. assertOk (fs. writeBytes ( "data.bin" , Bytes . empty ())) io. writeLine (test. assertOk (fs. readBytes ( "data.bin" )). toHex ()) Expected output Exit code 0
0041ff
invalid text rejected
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout 0041ff invalid text rejected This exact example has not been executed.
List immediate entries in exact name order run · running · Verification · not-run
main.tpz List immediate entries in exact name order import std.fs import std.test import std.io let entries = test. assertOk (fs. list ( "entries" )) for entry in (entries) { let size = match (entry.sizeBytes) { case Some(value) => "{value}" case None() => "none" } io. writeLine ( "{entry.name} {entry.kind} {size}" ) } Expected output Exit code 0
a.txt file 1
nested directory none
z.txt file 2
entries/z.txt List immediate entries in exact name order entries/a.txt List immediate entries in exact name order entries/nested/inside.txt List immediate entries in exact name order Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout a.txt file 1 nested directory none z.txt file 2 This exact example has not been executed.
Identify the operation and path in a readText error run · running · Verification · not-run
main.tpz Identify the operation and path in a readText error Open in Playground → import std.fs import std.bytes { Bytes } import std.test import std.io let error = test. assertErr (fs. readText ( "missing/item.txt" )) let operation = error. contains ( "readText" ) let path = error. contains ( "missing/item.txt" ) io. writeLine ( "{operation} {path}" ) Expected output Exit code 0
true true
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Identify the operation and path in a list error run · running · Verification · not-run
main.tpz Identify the operation and path in a list error Open in Playground → import std.fs import std.bytes { Bytes } import std.test import std.io let error = test. assertErr (fs. list ( "missing/item.txt" )) let operation = error. contains ( "list" ) let path = error. contains ( "missing/item.txt" ) io. writeLine ( "{operation} {path}" ) Expected output Exit code 0
true true
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Why Callers get a stable listing order and can identify the path of a failing operation.
Changed rules Read and replace whole files and list directories →
An explicit main consumes standard input once Adopted November 16, 2026 · 6.0.0 · Being verified
Problem After standard input is passed to main, a read in its body needs a defined result. Returning the data through both paths would change what it means to consume a stream.
Decision For main(args, stdin), read standard input to the end and pass it as stdin. A later io. read Stdin in the body returns an empty string.
Examples
The main argument consumes standard input run · runtime · Verification · not-run
main.tpz The main argument consumes standard input import std.io export function main (args: Array < string > , stdin: string ) -> Result < int , string > { io. writeLine (stdin) let exhausted = io. readStdin () == "" io. writeLine ( "{exhausted}" ) Ok( 0 ) } Expected output Exit code 0
incoming
true
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Alternatives considered Return the same input through both paths. An already consumed stream would appear readable a second time.Why Input is consumed once regardless of the path that reads it.
Changed rules Read standard input through its end →
File streams preserve existing files and share cursor state Adopted November 7, 2026 · 6.0.0 · Being verified
Problem A program can refer to an open file through more than one name. It needs to know whether opening preserves the contents and whether closing through one alias affects the others.
Decision Open an existing regular file for reading and writing without creating or truncating it. Aliases of the same handle share its cursor and closed state. Consume standard input through EOF. Use std. fs for whole-file replacement. Standard input is consumed through EOF, and a file write advances the cursor past the written bytes. Examples
Open and close an existing file without changing its bytes run · running · Verification · not-run
main.tpz Open and close an existing file without changing its bytes import std.io import std.fs import std.test let file = test. assertOk (io. open ( "source.txt" )) file. close () io. writeLine (test. assertOk (fs. readText ( "source.txt" ))) let missing = test. assertErr (io. open ( "missing.txt" )) let named = missing. contains ( "missing.txt" ) io. writeLine ( "missing {named}" ) Expected output Exit code 0
original
missing true
source.txt Open and close an existing file without changing its bytes Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Write at the cursor and retain the rest of the file run · running · Verification · not-run
main.tpz Write at the cursor and retain the rest of the file import std.io import std.fs import std.test let file = test. assertOk (io. open ( "source.txt" )) test. assertOk (file. write ( "XY" )) let tail = test. assertOk (file. read ()) io. writeLine ( "tail {tail}" ) file. close () let whole = test. assertOk (fs. readText ( "source.txt" )) io. writeLine ( "whole {whole}" ) Expected output Exit code 0
tail cdef
whole XYcdef
source.txt Write at the cursor and retain the rest of the file Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Close every alias and reject later access run · running · Verification · not-run
main.tpz Close every alias and reject later access import std.io import std.fs import std.test let file = test. assertOk (io. open ( "source.txt" )) let alias = file file. close () alias. close () test. assertErr (alias. read ()) io. writeLine ( "read rejected" ) test. assertErr (alias. write ( "changed" )) io. writeLine ( "write rejected" ) io. writeLine (test. assertOk (fs. readText ( "source.txt" ))) Expected output Exit code 0
read rejected
write rejected
original
source.txt Close every alias and reject later access Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout read rejected write rejected original This exact example has not been executed.
Share the cursor across file aliases run · running · Verification · not-run
main.tpz Share the cursor across file aliases import std.io import std.test let file = test. assertOk (io. open ( "source.txt" )) let alias = file io. writeLine (test. assertOk (file. read ())) let tail = test. assertOk (alias. read ()) let atEnd = tail == "" io. writeLine ( "{atEnd}" ) alias. close () Expected output Exit code 0
alpha
true
source.txt Share the cursor across file aliases Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Why Operations through one alias pick up where operations through another left off.
Changed rules Use a file handle with a shared cursor →
JSON null uses the kind check Adopted November 7, 2026 · 6.0.0 · In progress
Problem Code may need to test whether a JSON value is null. The same form can be used for all six JSON kinds.
Decision Use value. kind() == "null". The JSON Value. is Null() method is removed.
Examples
Distinguish null from every other JSON kind run · running · Verification · not-run
main.tpz Distinguish null from every other JSON kind Open in Playground → import std.json import std.test import std.io for source in ([ "null" , "false" , "0" , "\"\"" , "[]" , "\{\}" ]) { let value = test. assertOk (json. parse (source)) let kind = value. kind () let nullKind = kind == "null" io. writeLine ( "{kind}:{nullKind}" ) } Expected output Exit code 0
null:true
bool:false
number:false
string:false
array:false
object:false
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout null:true bool:false number:false string:false array:false object:false This exact example has not been executed.
Keep present null values distinct from missing entries run · running · Verification · not-run
main.tpz Keep present null values distinct from missing entries Open in Playground → import std.json import std.test import std.io let array = test. assertOk (json. parse ( "[null]" )) let object = test. assertOk (json. parse ( "\{\"present\":null\}" )) let arrayValue = test. assertSome (array. at ( 0 )) let objectValue = test. assertSome (object. get ( "present" )) test. assertNone (array. at ( 1 )) test. assertNone (object. get ( "absent" )) io. writeLine ( "{arrayValue. kind ()}:{objectValue. kind ()}" ) Expected output Exit code 0
null:null
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Use kind to test a JSON value for null check · checking · Verification · not-run
main.tpz Use kind to test a JSON value for null Open in Playground → import std.json { JSONValue } function inspect (value: JSONValue ) -> () { let result = value. kind () == "null" return () } Expected output Exit code 0
No stdout. Expected result Expected result Checking accepts the program. Exit code 0.
No stderr.
No stdout.
This exact example has not been executed.
Reject the removed JSONValue.isNull member reject · checking · Verification · not-run
main.tpz Reject the removed JSONValue.isNull member import std.json { JSONValue } function inspect (value: JSONValue ) -> () { let result = value. isNull () return () } Expected output Nonzero exit
No stdout. Expected result Expected result Rejection during check. Nonzero exit.
No stdout.
This exact example has not been executed.
Alternatives considered Keep is Null. Null would have two equivalent tests while the other kinds use kind().Why All six JSON kinds can be checked in the same way.
Changed rules Inspect JSON kinds with kind →
JSON numbers preserve their original spelling Adopted November 7, 2026 · 6.0.0 · Being verified
Problem JSON numbers 1 and 1e0 have the same mathematical value but different spellings. Direct projection from a tree and decoding to an integer have different requirements.
Decision Preserve the exact source spelling of each JSON number. as Int accepts signed decimal integer spellings in the signed 64-bit range.Typed integer decoding uses an exact mathematical conversion. Examples
Keep integer projection within the declared spelling and range run · running · Verification · not-run
main.tpz Keep integer projection within the declared spelling and range Open in Playground → import std.json import std.test import std.io for text in ([ "-9223372036854775808" , "9223372036854775807" , "9223372036854775808" , "-0" , "1.0" , "1e0" , "1.5" ]) { let value = test. assertOk (json. parse (text)) match (value. asInt ()) { case Some(number) => io. writeLine ( "{text} = {number}" ) case None() => io. writeLine ( "{text} = none" ) } } Expected output Exit code 0
-9223372036854775808 = -9223372036854775808
9223372036854775807 = 9223372036854775807
9223372036854775808 = none
-0 = 0
1.0 = none
1e0 = none
1.5 = none
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout -9223372036854775808 = -9223372036854775808 9223372036854775807 = 9223372036854775807 9223372036854775808 = none -0 = 0 1.0 = none 1e0 = none 1.5 = none This exact example has not been executed.
Retain numbers beyond binary and integer precision run · running · Verification · not-run
main.tpz Retain numbers beyond binary and integer precision Open in Playground → import std.json import std.test import std.io for text in ([ "9007199254740993" , "9223372036854775808" , "-0" , "1.2300e+03" , "1e9999" ]) { let value = test. assertOk (json. parse (text)) io. writeLine (test. assertSome (value. numberText ())) } Expected output Exit code 0
9007199254740993
9223372036854775808
-0
1.2300e+03
1e9999
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout 9007199254740993 9223372036854775808 -0 1.2300e+03 1e9999 This exact example has not been executed.
Decode a record after parsing and report invalid data run · running · Verification · not-run
main.tpz Decode a record after parsing and report invalid data Open in Playground → import std.json import std.test import std.io record Item derives JSON { name: string , count: int = 7 } let item = test. assertOk (json.parseAs < Item > ( "\{\"name\":\"ink\",\"extra\":true\}" )) io. writeLine ( "{item.name},{item.count}" ) for text in ([ "\{\}" , "17" , "[" , "\{\"name\":\"ink\",\"count\":9223372036854775808\}" ]) { match (json.parseAs < Item > (text)) { case Ok(_) => io. writeLine ( "accepted" ) case Err(_) => io. writeLine ( "invalid data" ) } } Expected output Exit code 0
ink,7
invalid data
invalid data
invalid data
invalid data
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout ink,7 invalid data invalid data invalid data invalid data This exact example has not been executed.
Why A reader can keep the original spelling and still request an exact conversion to an integer type.
Changed rules Project JSON values without coercion →Parse a complete JSON document →Parse text before typed JSON decoding →
JSON parsing consumes the whole document and rejects duplicate keys Adopted November 7, 2026 · 6.0.0 · Being verified
Problem Trailing text can follow a valid value, and two escaped spellings can decode to the same key. Error locations need to make sense in text containing multibyte characters.
Decision Parse one complete document and reject duplicate decoded keys. Limit nesting to 128 levels. Report one-based Unicode scalar positions. Point to the offending scalar, the opening quote of the second key, or the end of input. For the line number of an error position, CRLF is one line break, and a lone CR and a lone LF are each one line break. Examples
Locate the first invalid scalar and end of input run · running · Verification · not-run
main.tpz Locate the first invalid scalar and end of input Open in Playground → import std.json import std.io for text in ([ "" , "true false" , "[1,]" , "[1 x]" , "[\rtrue,\r?]" ]) { match (json. parse (text)) { case Ok(_) => io. writeLine ( "accepted" ) case Err(error) => io. writeLine ( "{error.line},{error.column}" ) } } Expected output Exit code 0
1,1
1,6
1,4
1,4
3,1
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Reject a repeated decoded key at its opening quote run · running · Verification · not-run
main.tpz Reject a repeated decoded key at its opening quote Open in Playground → import std.json import std.io match (json. parse ( "\{\"a\":1,\"\\u0061\":2\}" )) { case Ok(_) => io. writeLine ( "accepted" ) case Err(error) => io. writeLine ( "{error.line},{error.column}" ) } Expected output Exit code 0
1,8
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Decode surrogate pairs and reject malformed JSON spellings run · running · Verification · not-run
main.tpz Decode surrogate pairs and reject malformed JSON spellings Open in Playground → import std.json import std.test import std.io let value = test. assertOk (json. parse ( "\"\\uD83D\\uDE00\"" )) test. assertEq (test. assertSome (value. asString ()), "😀" ) for text in ([ "01" , "+1" , "1." , "1e" , "NaN" , "\"\\uD800\"" , "\"\\uDC00\"" ]) { match (json. parse (text)) { case Ok(_) => io. writeLine ( "accepted" ) case Err(_) => io. writeLine ( "invalid" ) } } Expected output Exit code 0
invalid
invalid
invalid
invalid
invalid
invalid
invalid
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout invalid invalid invalid invalid invalid invalid invalid This exact example has not been executed.
Accept depth 128 and reject the next child run · running · Verification · not-run
main.tpz Accept depth 128 and reject the next child Open in Playground → import std.json import std.io let mut text = "0" for level in ( 0 ..< 128 ) { text = "[" + text + "]" } match (json. parse (text)) { case Ok(_) => io. writeLine ( "depth 128 accepted" ) case Err(_) => io. writeLine ( "depth 128 rejected" ) } match (json. parse ( "[" + text + "]" )) { case Ok(_) => io. writeLine ( "depth 129 accepted" ) case Err(_) => io. writeLine ( "depth 129 rejected" ) } Expected output Exit code 0
depth 128 accepted
depth 129 rejected
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout depth 128 accepted depth 129 rejected This exact example has not been executed.
Why Invalid documents are rejected with a position the caller can locate directly in the input.
Changed rules Parse a complete JSON document →
JSON writing sorts object keys Adopted November 7, 2026 · 6.0.0 · In progress
Problem Different key orders make equivalent objects harder to compare as text. Typed parsing also needs to say when a custom decoder runs.
Decision Dispatch through the JSON protocol once. Emit compact JSON with sorted object keys. Preserve array order and stored number spellings. Finish parsing the document before invoking a typed decoder. parse As finishes parsing before it calls a decoder once. The effects of a user codec follow ordinary function evaluation.Examples
Write sorted objects and preserve a parsed number lexeme run · running · Verification · not-run
main.tpz Write sorted objects and preserve a parsed number lexeme Open in Playground → import std.json import std.test import std.io io. writeLine (test. assertOk (json. stringify (map { "z" : 1 , "a" : 2 }))) io. writeLine (test. assertOk (json. stringify ([ "a,b" , "x\"y" , "\n" , "é" ]))) let number = test. assertOk (json. parse ( "1.2300e+03" )) io. writeLine (test. assertOk (json. stringify (number))) let empty: Array < int > = [] io. writeLine (test. assertOk (json. stringify (empty))) Expected output Exit code 0
{"a":2,"z":1}
["a,b","x\"y","\n","é"]
1.2300e+03
[]
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout {"a":2,"z":1} ["a,b","x\"y","\n","é"] 1.2300e+03 [] This exact example has not been executed.
Call a custom decoder once after complete parsing run · running · Verification · not-run
main.tpz Call a custom decoder once after complete parsing import std.json { JSONValue , parseAs } import std.io record Token { text: string } impl JSON < Token > { function encode (value: Token ) -> Result < JSONValue , string > { JSON . encode (value.text) } function decode (value: JSONValue ) -> Result < Token , string > { io. writeLine ( "decode" ) match (value. asString ()) { case Some(text) => Ok( Token { text: text }) case None() => Err( "expected token string" ) } } } match (parseAs < Token > ( "\"ink\"" )) { case Ok(value) => io. writeLine (value.text) case Err(message) => io. writeLine (message) } match (parseAs < Token > ( "\"ink\" false" )) { case Ok(_) => io. writeLine ( "accepted" ) case Err(_) => io. writeLine ( "parse failed before decode" ) } Expected output Exit code 0
decode
ink
parse failed before decode
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout decode ink parse failed before decode This exact example has not been executed.
Why Output order is predictable, and incomplete input cannot invoke the decoder early.
Changed rules Serialize JSON in a deterministic order →Parse text before typed JSON decoding →
Adopted November 7, 2026 · 6.0.0 · Being verified
Problem If two columns have the same name, the name alone cannot identify one value. Reordering the columns could change which value a reader sees.
Decision Name-based CSV reading returns an error when a header name is repeated.
Examples
run · running · Verification · not-run
main.tpz Read unique named columns Open in Playground → import std.csv import std.test import std.io let rows = test. assertOk (csv. parseWithHeader ( "name,count\nTopaz,6" )) let row = test. assertSome (rows. get ( 0 )) io. writeLine (test. assertSome (row. get ( "name" ))) io. writeLine (test. assertSome (row. get ( "count" ))) Expected output Exit code 0
Topaz
6
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
run · running · Verification · not-run
main.tpz Reject duplicate names Open in Playground → import std.csv import std.io match (csv. parseWithHeader ( "name,name\nleft,right" )) { case Err(_) => io. writeLine ( "duplicate headers rejected" ) case Ok(_) => io. writeLine ( "accepted" ) } Expected output Exit code 0
duplicate headers rejected
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout duplicate headers rejected This exact example has not been executed.
run · running · Verification · not-run
main.tpz Reject duplicate names after reversing values Open in Playground → import std.csv import std.io match (csv. parseWithHeader ( "name,name\nright,left" )) { case Err(_) => io. writeLine ( "duplicate headers rejected" ) case Ok(_) => io. writeLine ( "accepted" ) } Expected output Exit code 0
duplicate headers rejected
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout duplicate headers rejected This exact example has not been executed.
run · running · Verification · not-run
main.tpz Reject duplicate names even when the values agree Open in Playground → import std.csv import std.io match (csv. parseWithHeader ( "name,name\nsame,same" )) { case Err(_) => io. writeLine ( "duplicate headers rejected" ) case Ok(_) => io. writeLine ( "accepted" ) } Expected output Exit code 0
duplicate headers rejected
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout duplicate headers rejected This exact example has not been executed.
run · running · Verification · not-run
main.tpz Preserve repeated header text in positional rows Open in Playground → import std.csv import std.test import std.io let rows = test. assertOk (csv. parse ( "name,name\nleft,right" )) let row = test. assertSome (rows. get ( 1 )) io. writeLine ( "{row[ 0 ]}:{row[ 1 ]}" ) Expected output Exit code 0
left:right
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Alternatives considered Use the first or last column with that name. Swapping the columns would change the value returned under the same name.Why Callers can detect duplicate headers before relying on values read by name.
Changed rules Require unique headers for named CSV rows →
Adopted November 7, 2026 · 6.0.0 · Being verified
Problem A caller can accidentally request the same output column twice. Rows can also omit a requested field or contain extra fields.
Decision stringify With Header returns Result<string, string> and rejects repeated requested column names.It preserves the requested order, writes an empty cell for each missing field, and ignores extra fields. It ends each record with LF and quotes a sole empty cell. Both writers end every record with LF and quote a sole empty field. Examples
run · running · Verification · not-run
main.tpz Choose output columns explicitly and fill absent cells Open in Playground → import std.csv import std.json import std.test import std.io let rows = [map { "name" : "Topaz" , "extra" : "ignored" , "count" : "6" }, map { "name" : "Ink" }] let text = test. assertOk (csv. stringifyWithHeader (rows, [ "count" , "name" ])) io. writeLine (test. assertOk (json. stringify (text))) let noRows: Array < Map < string , string >> = [] io. writeLine (test. assertOk (json. stringify (test. assertOk (csv. stringifyWithHeader (noRows, [ "name" ]))))) Expected output Exit code 0
"count,name\n6,Topaz\n,Ink\n"
"name\n"
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout "count,name\n6,Topaz\n,Ink\n" "name\n" This exact example has not been executed.
Reject duplicate columns before serializing a row run · running · Verification · not-run
main.tpz Reject duplicate columns before serializing a row Open in Playground → import std.csv import std.io let rows: Array < Map < string , string >> = [] match (csv. stringifyWithHeader (rows, [ "name" , "name" ])) { case Ok(_) => io. writeLine ( "accepted" ) case Err(_) => io. writeLine ( "duplicate columns rejected" ) } Expected output Exit code 0
duplicate columns rejected
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout duplicate columns rejected This exact example has not been executed.
Why The column list determines output order, and callers can handle a duplicate request as an error.
Changed rules Serialize positional and named CSV rows →
TOML accepts leap seconds and limits nesting to 128 Adopted November 16, 2026 · 6.0.0 · Being verified
Problem A TOML time can have a seconds field of 60. Very deep arrays and tables can also cause reading or writing to exhaust the stack.
Decision Accept a seconds value of 60 under RFC 3339. Reading and writing both limit nesting to 128 levels and return Err beyond that limit. Examples
A TOML leap second is accepted and excessive nesting is rejected run · runtime · Verification · not-run
main.tpz A TOML leap second is accepted and excessive nesting is rejected import std.io import std.toml match (toml. parse ( "date = 2016-12-31T23:59:60Z" )) { case Ok(_) => io. writeLine ( "leap second accepted" ) case Err(_) => io. writeLine ( "leap second rejected" ) } let mut left = "" let mut right = "" for depth in ( 0 ..< 129 ) { left = left + "[" right = right + "]" } match (toml. parse ( "value = " + left + "0" + right)) { case Ok(_) => io. writeLine ( "depth accepted" ) case Err(_) => io. writeLine ( "depth rejected" ) } Expected output Exit code 0
leap second accepted
depth rejected
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout leap second accepted depth rejected This exact example has not been executed.
Alternatives considered Reject seconds values of 60. That conflicts with the date and time format TOML follows.Leave nesting unlimited. A deeply nested array could exhaust the stack.Why Callers can read valid leap-second times and handle excessive nesting as an error.
Changed rules Parse complete TOML 1.0 documents →Write deterministic TOML documents →
TOML follows 1.0 and reports JSON conversion errors Adopted November 7, 2026 · 6.0.0 · Being verified
Problem TOML can express numbers that JSON cannot represent. Date kinds and integer ranges also need to remain distinct across conversions.
Decision Read TOML 1.0 forms and write the root table deterministically. Preserve binary64 values and distinct date and time kinds. to Json returns Result<JSON Value, string> and rejects nonfinite numbers. from Json rejects out-of-range integers.TOML keeps its date kinds, and converting a date to a JSON string drops its TOML kind. Examples
run · running · Verification · not-run
main.tpz Accept literal strings, multiline values, radix integers and dates Open in Playground → import std.toml import std.io for text in ([ "title = 'ink#paper'\n" , "text = \"\"\"\nfirst\nsecond\"\"\"\n" , "value = 0xff\n" , "date = 1979-05-27T07:32:00Z\n" , "value = inf\n" , "value = nan\n" ]) { match (toml. parse (text)) { case Ok(_) => io. writeLine ( "accepted" ) case Err(_) => io. writeLine ( "rejected" ) } } Expected output Exit code 0
accepted
accepted
accepted
accepted
accepted
accepted
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout accepted accepted accepted accepted accepted accepted This exact example has not been executed.
Reject a scalar as a complete TOML document run · running · Verification · not-run
main.tpz Reject a scalar as a complete TOML document Open in Playground → import std.json import std.toml import std.test import std.io let tree = test. assertOk (json. parse ( "7" )) let value = test. assertOk (toml. fromJson (tree)) match (toml. stringify (value)) { case Ok(_) => io. writeLine ( "accepted" ) case Err(_) => io. writeLine ( "root table required" ) } Expected output Exit code 0
root table required
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Convert a TOML table through a recoverable JSON result run · running · Verification · not-run
main.tpz Convert a TOML table through a recoverable JSON result import std.json import std.toml import std.test import std.io let value = test. assertOk (toml. parse ( "name = \"Topaz\"\ncount = 6\n" )) let tree = test. assertOk (value. toJson ()) io. writeLine (test. assertOk (json. stringify (tree))) let restored = test. assertOk (toml. fromJson (tree)) io. writeLine (test. assertOk (toml. stringify (restored))) Expected output Exit code 0
{"count":6,"name":"Topaz"}
count = 6
name = "Topaz"
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout {"count":6,"name":"Topaz"} count = 6 name = "Topaz" This exact example has not been executed.
Return an error for a TOML infinity during JSON conversion run · running · Verification · not-run
main.tpz Return an error for a TOML infinity during JSON conversion Open in Playground → import std.toml import std.test import std.io let value = test. assertOk (toml. parse ( "value = inf\n" )) match (value. toJson ()) { case Ok(_) => io. writeLine ( "accepted" ) case Err(_) => io. writeLine ( "nonfinite rejected" ) } Expected output Exit code 0
nonfinite rejected
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Reject null and out of range integer conversion run · running · Verification · not-run
main.tpz Reject null and out of range integer conversion Open in Playground → import std.json import std.toml import std.test import std.io for text in ([ "null" , "9223372036854775808" , "1e9999" ]) { let value = test. assertOk (json. parse (text)) match (toml. fromJson (value)) { case Ok(_) => io. writeLine ( "accepted" ) case Err(_) => io. writeLine ( "unrepresentable" ) } } Expected output Exit code 0
unrepresentable
unrepresentable
unrepresentable
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout unrepresentable unrepresentable unrepresentable This exact example has not been executed.
Why Callers can handle values the destination format cannot represent.
Changed rules Parse complete TOML 1.0 documents →Write deterministic TOML documents →Convert TOML and JSON with explicit failures →
Test loops use ordinary for Adopted November 7, 2026 · 6.0.0 · Being verified
Problem A test can repeat over integer or boolean cases. The ordinary loop can run the same cases.
Decision Use for in place of for All Int and for All Bool, which are removed.
Examples
Use one loop for every element type run · running · Verification · not-run
main.tpz Use one loop for every element type Open in Playground → import std.test import std.io let mut sum = 0 for value in ([ 2 , 3 , 5 ]) { sum += value } let mut trueCount = 0 for value in ([ true , false , true ]) { if (value) { trueCount += 1 } } let mut labels = "" for value in ([ "A" , "B" , "C" ]) { labels = labels + value } test. assertEq (sum, 10 ) test. assertEq (trueCount, 2 ) test. assertEq (labels, "ABC" ) io. writeLine ( "all values checked" ) Expected output Exit code 0
all values checked
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Reject the removed forAllInt helper reject · checking · Verification · not-run
main.tpz Reject the removed forAllInt helper Open in Playground → import std.test { forAllInt } Expected output Nonzero exit
No stdout. Expected result Expected result Rejection during resolve. Nonzero exit.
No stdout.
This exact example has not been executed.
Reject the removed forAllBool helper reject · checking · Verification · not-run
main.tpz Reject the removed forAllBool helper Open in Playground → import std.test { forAllBool } Expected output Nonzero exit
No stdout. Expected result Expected result Rejection during resolve. Nonzero exit.
No stdout.
This exact example has not been executed.
Alternatives considered Keep the test-only loop functions. The same iteration would have two equivalent spellings.Why Tests use the same iteration rules as the rest of the program.
Changed rules Repeat assertions with for →
Parser scans use Unicode scalar positions Adopted November 7, 2026 · 6.0.0 · Being verified
Problem A scan looking for ASCII can still receive Unicode text. Out-of-range starting positions and non-ASCII integers also need defined behavior.
Decision Integer ASCII predicates return a result for every integer input. Scans clamp the starting position and return the exclusive scalar end of the longest matching span. Indexed predicates and range scans use the same Unicode scalar position unit. Examples
Include each ASCII endpoint and exclude its neighbors run · running · Verification · not-run
main.tpz Include each ASCII endpoint and exclude its neighbors Open in Playground → import std.parser import std.io for cp in ([ 47 , 48 , 57 , 58 , 64 , 65 , 90 , 91 , 96 , 97 , 122 , 123 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 31 , 32 , 33 ]) { let digit = parser. isAsciiDigitCode (cp) let alpha = parser. isAsciiAlphaCode (cp) let alnum = parser. isAsciiAlnumCode (cp) let space = parser. isAsciiWhitespaceCode (cp) io. writeLine ( "{digit}/{alpha}/{alnum}/{space}" ) } Expected output Exit code 0
false/false/false/false
true/false/true/false
true/false/true/false
false/false/false/false
false/false/false/false
false/true/true/false
false/true/true/false
false/false/false/false
false/false/false/false
false/true/true/false
false/true/true/false
false/false/false/false
false/false/false/false
false/false/false/true
false/false/false/true
false/false/false/true
false/false/false/true
false/false/false/true
false/false/false/false
false/false/false/false
false/false/false/true
false/false/false/false
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout false/false/false/false true/false/true/false true/false/true/false false/false/false/false false/false/false/false false/true/true/false false/true/true/false false/false/false/false false/false/false/false false/true/true/false false/true/true/false false/false/false/false false/false/false/false false/false/false/true false/false/false/true false/false/false/true false/false/false/true false/false/false/true false/false/false/false false/false/false/false false/false/false/true false/false/false/false This exact example has not been executed.
Return false for invalid code points and non ASCII values run · running · Verification · not-run
main.tpz Return false for invalid code points and non ASCII values Open in Playground → import std.parser import std.io for cp in ([ - 1 , 128 , 233 , 55296 , 1114112 , 9223372036854775807 ]) { let digit = parser. isAsciiDigitCode (cp) let alpha = parser. isAsciiAlphaCode (cp) let alnum = parser. isAsciiAlnumCode (cp) let space = parser. isAsciiWhitespaceCode (cp) io. writeLine ( "{digit}/{alpha}/{alnum}/{space}" ) } Expected output Exit code 0
false/false/false/false
false/false/false/false
false/false/false/false
false/false/false/false
false/false/false/false
false/false/false/false
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout false/false/false/false false/false/false/false false/false/false/false false/false/false/false false/false/false/false false/false/false/false This exact example has not been executed.
Stop at non ASCII scalars without changing position units run · running · Verification · not-run
main.tpz Stop at non ASCII scalars without changing position units Open in Playground → import std.parser import std.io let digit = parser. takeWhileAsciiDigit ( "é12x" , 1 ) let combining = parser. takeWhileAsciiAlpha ( "éA" , 0 ) let suffix = parser. takeWhileAsciiAlpha ( "éA" , 2 ) let nonbreaking = parser. takeWhileAsciiWhitespace ( " " , 0 ) let alnum = parser. takeWhileAsciiAlnum ( "Aé" , 0 ) io. writeLine ( "{digit}/{combining}/{suffix}/{nonbreaking}/{alnum}" ) Expected output Exit code 0
3/1/3/0/1
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Clamp starts and keep the first failing position run · running · Verification · not-run
main.tpz Clamp starts and keep the first failing position Open in Playground → import std.parser import std.io let text = "12" for start in ([ - 3 , 0 , 1 , 2 , 99 ]) { let digit = parser. takeWhileAsciiDigit (text, start) let alpha = parser. takeWhileAsciiAlpha (text, start) let alnum = parser. takeWhileAsciiAlnum (text, start) let space = parser. takeWhileAsciiWhitespace (text, start) io. writeLine ( "{digit}/{alpha}/{alnum}/{space}" ) } let empty = "" let digit = parser. takeWhileAsciiDigit (empty, 99 ) let alpha = parser. takeWhileAsciiAlpha (empty, - 1 ) let alnum = parser. takeWhileAsciiAlnum (empty, 0 ) let space = parser. takeWhileAsciiWhitespace (empty, 1 ) io. writeLine ( "{digit}/{alpha}/{alnum}/{space}" ) Expected output Exit code 0
2/0/2/0
2/0/2/0
2/1/2/1
2/2/2/2
2/2/2/2
0/0/0/0
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout 2/0/2/0 2/0/2/0 2/1/2/1 2/2/2/2 2/2/2/2 0/0/0/0 This exact example has not been executed.
Why The returned end can serve as the start of the next scan.
Changed rules Classify integer ASCII codes →Classify a scalar position →Scan a maximal ASCII span →
Scaled-point conversion uses toScaledPoints Adopted November 7, 2026 · 6.0.0 · In progress
Problem Obtaining a grid integer from a length could look like a property read. The name can signal that it is a conversion.
Decision Use to Scaled Points in place of scaled Points.
Examples
Convert every physical length unit to scaled points run · running · Verification · not-run
main.tpz Convert every physical length unit to scaled points import std.io import std.typeset as ts let pt = ( 1 pt). toScaledPoints () let mm = ( 25.4 mm). toScaledPoints () let cm = ( 2.54 cm). toScaledPoints () let inch = ( 1 in). toScaledPoints () io. writeLine ( "{pt}|{mm}|{cm}|{inch}|{ts. fromScaledPoints (pt) == 1 pt}" ) Expected output Exit code 0
65536|4718592|4718592|4718592|true
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout 65536|4718592|4718592|4718592|true This exact example has not been executed.
Keep the millipoint conversion boundary run · running · Verification · not-run
main.tpz Keep the millipoint conversion boundary Open in Playground → import std.io import std.typeset as ts let tie = ts. fromScaledPoints ( 4096 ). toMilliPoints () let rounded = ts. fromMilliPoints ( 1 ) == ts. fromScaledPoints ( 66 ) io. writeLine ( "{tie}|{rounded}" ) Expected output Exit code 0
62|true
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Alternatives considered Preserve both names. The same conversion would remain available under two names.Why The prefix identifies the operation as a conversion, like other to methods.
Changed rules Convert physical lengths with toScaledPoints →
Public typesetting distances use Length of points Adopted November 7, 2026 · 6.0.0 · In progress
Problem A raw integer for a line width or inset leaves callers guessing which grid it uses. Changing the grid should not change the stated physical distance.
Decision Use Length<Pt> for public distances in std. typeset. Convert to grid units at the calculation boundary.
Examples
Use point lengths in Box check · checking · Verification · not-run
main.tpz Use point lengths in Box import std.typeset as ts let value: ts. Box = ts. Box { unitIndex: 0 , text: "A" , width: 12 pt, trackingAfter: 0 pt } let distance: Length < Pt > = value.width Expected output Exit code 0
No stdout. Expected result Expected result Checking accepts the program. Exit code 0.
No stderr.
No stdout.
This exact example has not been executed.
Reject untyped physical distances in Box reject · checking · Verification · not-run
main.tpz Reject untyped physical distances in Box import std.typeset as ts let value: ts. Box = ts. Box { unitIndex: 0 , text: "A" , width: 12 , trackingAfter: 0 } Expected output Nonzero exit
No stdout. Expected result Expected result Rejection during check. Nonzero exit.
No stdout.
This exact example has not been executed.
Pass typed distances to the line-cost function check · checking · Verification · not-run
main.tpz Pass typed distances to the line-cost function import std.typeset as ts let value = ts. lineBadness ( 20 pt, 20 pt, 4 , 1 , ts. BreakKind . ForcedEnd (), false , 0 , 0 pt) Expected output Exit code 0
No stdout. Expected result Expected result Checking accepts the program. Exit code 0.
No stderr.
No stdout.
This exact example has not been executed.
Reject raw distances at the line-cost boundary reject · checking · Verification · not-run
main.tpz Reject raw distances at the line-cost boundary import std.typeset as ts let value = ts. lineBadness ( 20 , 20 , 4 , 1 , ts. BreakKind . ForcedEnd (), false , 0 , 0 ) Expected output Nonzero exit
No stdout. Expected result Expected result Rejection during check. Nonzero exit.
No stdout.
This exact example has not been executed.
Use point lengths in BreakCluster check · checking · Verification · not-run
main.tpz Use point lengths in BreakCluster import std.typeset as ts let value: ts. BreakCluster = ts. BreakCluster { text: "A" , advance: 12 pt, trackingAfter: 0 pt } let distance: Length < Pt > = value.advance Expected output Exit code 0
No stdout. Expected result Expected result Checking accepts the program. Exit code 0.
No stderr.
No stdout.
This exact example has not been executed.
Reject untyped physical distances in BreakCluster reject · checking · Verification · not-run
main.tpz Reject untyped physical distances in BreakCluster import std.typeset as ts let value: ts. BreakCluster = ts. BreakCluster { text: "A" , advance: 12 , trackingAfter: 0 } Expected output Nonzero exit
No stdout. Expected result Expected result Rejection during check. Nonzero exit.
No stdout.
This exact example has not been executed.
Alternatives considered Expose raw grid integers in the API. Each caller would need to know the unit and when conversion occurs.Why The type carries the distance unit while calculations can select a grid.
Changed rules Give public typesetting distances a point-length type →
The CJK cluster classification is named CjkCluster Adopted November 7, 2026 · 6.0.0 · In progress
Problem The former name suggested a Korean-only rule. The classification serves Chinese, Japanese and Korean text.
Decision Rename Korean Cluster to Cjk Cluster to reflect its classification scope.
Examples
Use the CJK cluster variant check · checking · Verification · not-run
main.tpz Use the CJK cluster variant import std.typeset as ts let kind: ts. BreakKind = ts. BreakKind . CjkCluster () Expected output Exit code 0
No stdout. Expected result Expected result Checking accepts the program. Exit code 0.
No stderr.
No stdout.
This exact example has not been executed.
Reject the former KoreanCluster name reject · checking · Verification · not-run
main.tpz Reject the former KoreanCluster name import std.typeset as ts let kind = ts. BreakKind . KoreanCluster () Expected output Nonzero exit
No stdout. Expected result Expected result Rejection during check. Nonzero exit.
No stdout.
This exact example has not been executed.
Alternatives considered Keep the old name. The name would continue to hide the broader scope.Why The classification's scope is visible in its name.
Changed rules Name the CJK cluster break category →
An empty final line follows the 52 percent threshold Adopted November 7, 2026 · 6.0.0 · In progress
Problem A final line with no characters could use a different cost rule from other short final lines. Empty results need the same threshold.
Decision Apply the below-52-percent rule even when the character count is zero. The empty final line costs 1185000000.
Examples
Apply the last-line width condition to zero characters run · running · Verification · not-run
main.tpz Apply the last-line width condition to zero characters import std.typeset as ts import std.test import std.io function show (value: Result < int , ts. TypesetError > ) -> () { let cost = test. assertOk (value) io. writeLine ( "{cost}" ) } show (ts. lineBadness ( 0 pt, 100 pt, 0 , 0 , ts. BreakKind . ForcedEnd (), true , 0 , 0 pt)) Expected output Exit code 0
1185000000
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Use a strict last-line width threshold run · running · Verification · not-run
main.tpz Use a strict last-line width threshold import std.typeset as ts import std.test import std.io function show (value: Result < int , ts. TypesetError > ) -> () { let cost = test. assertOk (value) io. writeLine ( "{cost}" ) } show (ts. lineBadness ( 52 pt, 100 pt, 4 , 0 , ts. BreakKind . ForcedEnd (), true , 0 , 0 pt)) show (ts. lineBadness ( 51 pt, 100 pt, 4 , 0 , ts. BreakKind . ForcedEnd (), true , 0 , 0 pt)) Expected output Exit code 0
102160000
606040000
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Alternatives considered Apply the threshold only to nonempty lines. An empty final line would remain a special case.Why The same final-line threshold applies to an empty result.
Changed rules Compute fixed-point line badness from point lengths →
The line cost function is named lineBadness Adopted November 7, 2026 · 6.0.0 · In progress
Problem A name ending in millipoints suggests raw grid integers even when the function receives a length type. The type already states the unit.
Decision Rename line Badness Mpt to line Badness.
Examples
Compute a line cost from point lengths run · running · Verification · not-run
main.tpz Compute a line cost from point lengths import std.io import std.typeset as ts let cost = ts. lineBadness ( 20 pt, 20 pt, 4 , 1 , ts. BreakKind . ForcedEnd (), false , 0 , 0 pt) match (cost) { case Ok(value) => io. writeLine ( "{value}" ) case Err(_) => io. writeLine ( "unexpected input error" ) } Expected output Exit code 0
10000000
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Reject the former millipoint function name reject · checking · Verification · not-run
main.tpz Reject the former millipoint function name import std.typeset { lineBadnessMpt } Expected output Nonzero exit
No stdout. Expected result Expected result Rejection during resolve. Nonzero exit.
No stdout.
This exact example has not been executed.
Alternatives considered Keep the millipoint suffix. The name would imply a different unit from the length type.Why Use the type to identify the unit.
Changed rules Compute fixed-point line badness from point lengths →
The letter-spacing cap is a font-relative length Adopted November 7, 2026 · 6.0.0 · In progress
Problem A raw multiplier does not show whether the value represents a length or another ratio. The physical result depends on font size.
Decision max Letter Spacing Em takes Length<Em>.Resolve it against the font size of type Length<Pt> before converting to grid units. Millipoint ties round to the nearest even value. Examples
Store a relative spacing length and an explicit point font size check · checking · Verification · not-run
main.tpz Store a relative spacing length and an explicit point font size import std.typeset as ts let value = ts. LatinSpacing { minWordSpaceRatio: 0.8 , maxWordSpaceRatio: 1.33 , maxLetterSpacingEm: 0.01 em, fontSizePt: 12 pt } let relative: Length < Em > = value.maxLetterSpacingEm let physical: Length < Pt > = relative. resolve (value.fontSizePt) Expected output Exit code 0
No stdout. Expected result Expected result Checking accepts the program. Exit code 0.
No stderr.
No stdout.
This exact example has not been executed.
Resolve the stored spacing before converting to the computation grid run · running · Verification · not-run
main.tpz Resolve the stored spacing before converting to the computation grid import std.typeset as ts import std.io let spacing = ts. LatinSpacing { minWordSpaceRatio: 0.8 , maxWordSpaceRatio: 1.33 , maxLetterSpacingEm: 0.01 em, fontSizePt: 12 pt } let limit = spacing.maxLetterSpacingEm. resolve (spacing.fontSizePt) let exact = limit == ts. fromScaledPoints ( 7860 ) let millipoints = limit. toMilliPoints () io. writeLine ( "{exact}|{millipoints}" ) Expected output Exit code 0
true|120
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Apply nearest-even rounding at each typed value boundary run · running · Verification · not-run
main.tpz Apply nearest-even rounding at each typed value boundary Open in Playground → import std.typeset as ts import std.io let lowTie = ( 0.5 em). resolve (ts. fromScaledPoints ( 3 )) == ts. fromScaledPoints ( 2 ) let highTie = ( 0.5 em). resolve (ts. fromScaledPoints ( 5 )) == ts. fromScaledPoints ( 2 ) let literalGrid = ( 0.01 em). resolve ( 12 pt) == ts. fromScaledPoints ( 7860 ) let gridLow = ( 0.5 em). resolve ( 0.125 pt). toMilliPoints () let gridHigh = ( 0.5 em). resolve ( 0.375 pt). toMilliPoints () io. writeLine ( "{lowTie}|{highTie}|{literalGrid}|{gridLow}|{gridHigh}" ) Expected output Exit code 0
true|true|true|62|188
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Reject an untyped multiplier in the relative-length field reject · checking · Verification · not-run
main.tpz Reject an untyped multiplier in the relative-length field import std.typeset as ts let spacing = ts. LatinSpacing { minWordSpaceRatio: 0.8 , maxWordSpaceRatio: 1.33 , maxLetterSpacingEm: 0.01 , fontSizePt: 12 pt } Expected output Nonzero exit
No stdout. Expected result Expected result Rejection during check. Nonzero exit.
No stdout.
This exact example has not been executed.
Alternatives considered Keep relative spacing as a floating-point multiplier. The same type would represent both lengths and dimensionless ratios.Why The relative unit and the font size make the spacing calculation explicit.
Changed rules Resolve relative letter spacing through Length →
Typesetting picks the same breaks under the same conditions Adopted November 7, 2026 · 6.0.0 · In progress
Problem Two plans can have equal cost. If the choice varies between runs, identical manuscript input can produce different output.
Decision With the same input order, policy, calculation grid and release, line breaks, selected kinds, widths, costs and error variants match. Define a selection rule for candidates with equal cost. Examples
Retain a deterministic choice among equal cost candidates run · running · Verification · not-run
main.tpz Retain a deterministic choice among equal cost candidates import std.typeset as ts import std.io import std.test let items: Array < ts. Item > = [ ts. Item . BoxItem (ts. Box { unitIndex: 0 , text: "word" , width: 10 pt, trackingAfter: 0 pt }), ts. Item . PenaltyItem (ts. Penalty { unitEnd: 1 , width: 0 pt, rule: ts. BreakRule . Allowed ( 0 ), kind: ts. BreakKind . LatinSpace (), flagged: false }), ts. Item . PenaltyItem (ts. Penalty { unitEnd: 1 , width: 0 pt, rule: ts. BreakRule . Allowed ( 0 ), kind: ts. BreakKind . ClosingPunctuation (), flagged: false }) ] let input = ts. Paragraph { grid: ts. DistanceGrid . MilliPoint (), items: items, geometry: ts. LineGeometry { bodyTarget: 10 pt, firstTarget: 10 pt, dropCapSpan: 0 , dropCapInset: 0 pt }, justification: ts. JustificationPolicy { mode: ts. JustificationMode . Unjustified (), minGapCount: 0 , minLineWidthRatioM: 0 , minFinalLineWidthRatioM: None(), maxAdjustment: 0 pt, maxGapAdjustment: 0 pt, maxGapRatioR: 0 , latinSpacing: None(), cjkStretchRatio: 0.0 }, costModel: ts. CostModel . FixedPoint (), knuthPlass: ts. KnuthPlassPolicy { toleranceR: 100000000 , linePenalty: 10 , fitnessDemerit: 0 , flaggedDemerit: 0 , finalFlaggedDemerit: 0 } } function category (kind: ts. BreakKind ) -> string { match (kind) { case LatinSpace () => "space" case ClosingPunctuation () => "punctuation" case _ => "unexpected kind" } } for pass in ([ 0 , 1 ]) { let result = test. assertOk (ts. breakParagraph (input)) let optimized = result.optimized.lines[ 0 ] let greedy = result.greedy.lines[ 0 ] io. writeLine ( "{pass} {optimized.start} {optimized.endExclusive} { category (optimized.kind)} { category (greedy.kind)}" ) } Expected output Exit code 0
0 0 1 space punctuation
1 0 1 space punctuation
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout 0 0 1 space punctuation 1 0 1 space punctuation This exact example has not been executed.
run · running · Verification · not-run
main.tpz Report the same first failing stage for repeated invalid input import std.typeset as ts import std.io let items: Array < ts. Item > = [ ts. Item . BoxItem (ts. Box { unitIndex: 2 , text: "a" , width: 1 pt, trackingAfter: 0 pt }) ] let input = ts. Paragraph { grid: ts. DistanceGrid . MilliPoint (), items: items, geometry: ts. LineGeometry { bodyTarget: 0 pt, firstTarget: 0 pt, dropCapSpan: 0 , dropCapInset: 0 pt }, justification: ts. JustificationPolicy { mode: ts. JustificationMode . Unjustified (), minGapCount: 0 , minLineWidthRatioM: 0 , minFinalLineWidthRatioM: None(), maxAdjustment: 0 pt, maxGapAdjustment: 0 pt, maxGapRatioR: 0 , latinSpacing: None(), cjkStretchRatio: 0.0 }, costModel: ts. CostModel . FixedPoint (), knuthPlass: ts. KnuthPlassPolicy { toleranceR: 100000000 , linePenalty: 10 , fitnessDemerit: 0 , flaggedDemerit: 0 , finalFlaggedDemerit: 0 } } for pass in ([ 0 , 1 ]) { match (ts. breakParagraph (input)) { case Err( InvalidPolicy (_)) => io. writeLine ( "{pass} InvalidPolicy" ) case _ => io. writeLine ( "unexpected result" ) } } Expected output Exit code 0
0 InvalidPolicy
1 InvalidPolicy
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout 0 InvalidPolicy 1 InvalidPolicy This exact example has not been executed.
Alternatives considered Allow equal-cost plans to vary across runs. The same manuscript could get different line breaks or errors.Why A plan can be reproduced under the same conditions.
Changed rules Repeat a paragraph plan deterministically →
Break classification and paragraph planning have distinct boundaries Adopted November 7, 2026 · 6.0.0 · In progress
Problem Determining whether a character boundary permits a break differs from selecting a line ending. Using one grid for both can make classification depend on planning settings.
Decision classify Breaks compares stored point ticks. Quantize to Paragraph. grid for paragraph planning.Break Kind describes classification and Break Rule constrains planning. Non-tailorable Unicode decisions take priority. A shaping conflict is invalid input.Examples
Keep exact point measurements at the classifier boundary run · running · Verification · not-run
main.tpz Keep exact point measurements at the classifier boundary import std.typeset as ts import std.test import std.io let clusters = [ ts. BreakCluster { text: "a" , advance: 0.5002 pt, trackingAfter: 0 pt }, ts. BreakCluster { text: "b" , advance: 0.5002 pt, trackingAfter: 0 pt } ] let policy = ts. BreakPolicy { mode: ts. BreakMode . Word (), rules: ts. KinsokuRules . AtlasDefault (), forbidBefore: [], forbidAfter: [], boundaryAllowed: [ true , true ], generatedHyphenEnds: [], protectFittingLatin: false , preserveShortWords: false , narrowestWordTarget: 0 pt, bodyWordTarget: 1 pt } let result = test. assertOk (ts. classifyBreaks (clusters, policy)) for boundary in (result) { io. writeLine ( "{boundary.unitEnd}" ) } Expected output Exit code 0
1
2
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Reject a cluster that hides a mandatory Unicode break run · running · Verification · not-run
main.tpz Reject a cluster that hides a mandatory Unicode break import std.typeset as ts import std.io import std.test function outcome (value: Result < Array < ts. BreakOpportunity > , ts. TypesetError > ) -> string { match (value) { case Ok(_) => "Ok" case Err( InvalidInput (_)) => "InvalidInput" case Err( InvalidPolicy (_)) => "InvalidPolicy" case Err(_) => "unexpected error" } } let clusters = [ts. BreakCluster { text: "A\nB" , advance: 1 pt, trackingAfter: 0 pt }] let selected = ts. BreakPolicy { mode: ts. BreakMode . Character (), rules: ts. KinsokuRules . Unicode16Ja (), forbidBefore: [], forbidAfter: [], boundaryAllowed: [ true ], generatedHyphenEnds: [], protectFittingLatin: false , preserveShortWords: false , narrowestWordTarget: 0 pt, bodyWordTarget: 0 pt } io. writeLine ( outcome (ts. classifyBreaks (clusters, selected))) Expected output Exit code 0
InvalidInput
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Keep signed penalty preferences distinct from hard break rules run · running · Verification · not-run
main.tpz Keep signed penalty preferences distinct from hard break rules Open in Playground → import std.typeset as ts import std.io import std.test let rules = [ts. BreakRule . Allowed ( - 10000 ), ts. BreakRule . Allowed ( 0 ), ts. BreakRule . Allowed ( 10000 )] for rule in (rules) { match (rule) { case Allowed (value) => io. writeLine ( "{value}" ) case _ => io. writeLine ( "unexpected rule" ) } } Expected output Exit code 0
-10000
0
10000
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Alternatives considered Combine classification and planning constraints. A planning choice could obscure the original character boundary rule.Why Classification can be inspected separately from line costs and constraints.
Changed rules Classify measured clusters into an ordered boundary sequence →Keep boundary policy separate from break category →Express preference, mandatory breaks, and forbidden breaks explicitly →
Adopted November 7, 2026 · 6.0.0 · In progress
Problem Filtering or editing can leave no clusters or no paragraph content. A rejection would make each caller synthesize its own result.
Decision For otherwise valid input, an empty cluster array or paragraph succeeds with an empty result.
Examples
Classify an empty cluster sequence run · running · Verification · not-run
main.tpz Classify an empty cluster sequence import std.typeset as ts import std.io import std.test let clusters: Array < ts. BreakCluster > = [] let selected = ts. BreakPolicy { mode: ts. BreakMode . Character (), rules: ts. KinsokuRules . AtlasDefault (), forbidBefore: [], forbidAfter: [], boundaryAllowed: [], generatedHyphenEnds: [], protectFittingLatin: false , preserveShortWords: false , narrowestWordTarget: 0 pt, bodyWordTarget: 0 pt } let breaks = test. assertOk (ts. classifyBreaks (clusters, selected)) io. writeLine ( "{breaks.length}" ) Expected output Exit code 0
0
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Plan a valid empty paragraph run · running · Verification · not-run
main.tpz Plan a valid empty paragraph import std.typeset as ts import std.io let items: Array < ts. Item > = [ ] let input = ts. Paragraph { grid: ts. DistanceGrid . MilliPoint (), items: items, geometry: ts. LineGeometry { bodyTarget: 10 pt, firstTarget: 10 pt, dropCapSpan: 0 , dropCapInset: 0 pt }, justification: ts. JustificationPolicy { mode: ts. JustificationMode . Unjustified (), minGapCount: 0 , minLineWidthRatioM: 0 , minFinalLineWidthRatioM: None(), maxAdjustment: 0 pt, maxGapAdjustment: 0 pt, maxGapRatioR: 0 , latinSpacing: None(), cjkStretchRatio: 0.0 }, costModel: ts. CostModel . FixedPoint (), knuthPlass: ts. KnuthPlassPolicy { toleranceR: 100000000 , linePenalty: 10 , fitnessDemerit: 0 , flaggedDemerit: 0 , finalFlaggedDemerit: 0 } } match (ts. breakParagraph (input)) { case Ok(result) => { io. writeLine ( "{result.optimized.lines.length} {result.greedy.lines.length}" ) io. writeLine ( "{result.optimized.totalCost} {result.greedy.totalCost} {result.breakOpportunityCount}" ) } case Err(_) => io. writeLine ( "unexpected error" ) } Expected output Exit code 0
0 0
0 0 0
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Alternatives considered Reject empty input as an error. Callers would need to special-case empty input before using the operation.Why Empty content can follow the same result pipeline.
Changed rules Classify measured clusters into an ordered boundary sequence →Choose deterministic paragraph plans →
A nonempty paragraph needs a permitted final shaping boundary Adopted November 7, 2026 · 6.0.0 · In progress
Problem Shaping information can mark a boundary as unavailable for a break. If rulesets disagree about the last one, identical input can be valid in one path and invalid in another.
Decision Every ruleset requires the final shaping boundary of nonempty input to permit a break. A violation returns Invalid Input.
Examples
Reject a masked paragraph end in every ruleset run · running · Verification · not-run
main.tpz Reject a masked paragraph end in every ruleset import std.typeset as ts import std.io import std.test function outcome (value: Result < Array < ts. BreakOpportunity > , ts. TypesetError > ) -> string { match (value) { case Ok(_) => "Ok" case Err( InvalidInput (_)) => "InvalidInput" case Err( InvalidPolicy (_)) => "InvalidPolicy" case Err(_) => "unexpected error" } } let clusters = [ts. BreakCluster { text: "a" , advance: 1 pt, trackingAfter: 0 pt }] let atlas = ts. BreakPolicy { mode: ts. BreakMode . Character (), rules: ts. KinsokuRules . AtlasDefault (), forbidBefore: [], forbidAfter: [], boundaryAllowed: [ false ], generatedHyphenEnds: [], protectFittingLatin: false , preserveShortWords: false , narrowestWordTarget: 0 pt, bodyWordTarget: 0 pt } let unicode = ts. BreakPolicy { mode: ts. BreakMode . Character (), rules: ts. KinsokuRules . Unicode16Ja (), forbidBefore: [], forbidAfter: [], boundaryAllowed: [ false ], generatedHyphenEnds: [], protectFittingLatin: false , preserveShortWords: false , narrowestWordTarget: 0 pt, bodyWordTarget: 0 pt } io. writeLine ( outcome (ts. classifyBreaks (clusters, atlas))) io. writeLine ( outcome (ts. classifyBreaks (clusters, unicode))) Expected output Exit code 0
InvalidInput
InvalidInput
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Alternatives considered Treat the final boundary differently in different rulesets. Identical shaping data could be accepted on one path and rejected on another.Why There is one condition for reaching the end of the paragraph.
Changed rules Classify measured clusters into an ordered boundary sequence →
Paragraph planning states its search and returns two results Adopted November 7, 2026 · 6.0.0 · In progress
Problem Calling a plan good does not say which candidates were compared. A fast choice and a broader search can take different paths through one paragraph.
Decision FixedPoint starts with 80 preceding candidates and expands the search. KnuthPlass visits all predecessors. Each uses its own admission and cost rules. One call returns both an optimized result and a greedy result. Examples
Plan a paragraph through its supplied boundaries run · running · Verification · not-run
main.tpz Plan a paragraph through its supplied boundaries import std.typeset as ts import std.io let items: Array < ts. Item > = [ ts. Item . BoxItem (ts. Box { unitIndex: 0 , text: "a" , width: 1 pt, trackingAfter: 0 pt }), ts. Item . BoxItem (ts. Box { unitIndex: 1 , text: "a" , width: 1 pt, trackingAfter: 0 pt }), ts. Item . PenaltyItem (ts. Penalty { unitEnd: 2 , width: 0 pt, rule: ts. BreakRule . Allowed ( 0 ), kind: ts. BreakKind . LatinSpace (), flagged: false }), ts. Item . BoxItem (ts. Box { unitIndex: 2 , text: "a" , width: 1 pt, trackingAfter: 0 pt }), ts. Item . BoxItem (ts. Box { unitIndex: 3 , text: "a" , width: 1 pt, trackingAfter: 0 pt }), ts. Item . PenaltyItem (ts. Penalty { unitEnd: 4 , width: 0 pt, rule: ts. BreakRule . Forced (), kind: ts. BreakKind . ForcedEnd (), flagged: false }) ] let input = ts. Paragraph { grid: ts. DistanceGrid . MilliPoint (), items: items, geometry: ts. LineGeometry { bodyTarget: 2 pt, firstTarget: 2 pt, dropCapSpan: 0 , dropCapInset: 0 pt }, justification: ts. JustificationPolicy { mode: ts. JustificationMode . Unjustified (), minGapCount: 0 , minLineWidthRatioM: 0 , minFinalLineWidthRatioM: None(), maxAdjustment: 0 pt, maxGapAdjustment: 0 pt, maxGapRatioR: 0 , latinSpacing: None(), cjkStretchRatio: 0.0 }, costModel: ts. CostModel . FixedPoint (), knuthPlass: ts. KnuthPlassPolicy { toleranceR: 100000000 , linePenalty: 10 , fitnessDemerit: 0 , flaggedDemerit: 0 , finalFlaggedDemerit: 0 } } match (ts. breakParagraph (input)) { case Ok(result) => { for line in (result.optimized.lines) { io. writeLine ( "{line.start} {line.endExclusive}" ) } io. writeLine ( "{result.greedy.lines.length} {result.breakOpportunityCount}" ) } case Err(_) => io. writeLine ( "unexpected error" ) } Expected output Exit code 0
0 2
2 4
2 2
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Report a missing greedy completion run · running · Verification · not-run
main.tpz Report a missing greedy completion import std.typeset as ts import std.io let items: Array < ts. Item > = [ ts. Item . BoxItem (ts. Box { unitIndex: 0 , text: "a" , width: 1 pt, trackingAfter: 0 pt }), ts. Item . BoxItem (ts. Box { unitIndex: 1 , text: "a" , width: 1 pt, trackingAfter: 0 pt }), ts. Item . PenaltyItem (ts. Penalty { unitEnd: 1 , width: 0 pt, rule: ts. BreakRule . Allowed ( 0 ), kind: ts. BreakKind . ForcedEnd (), flagged: false }) ] let input = ts. Paragraph { grid: ts. DistanceGrid . MilliPoint (), items: items, geometry: ts. LineGeometry { bodyTarget: 10 pt, firstTarget: 10 pt, dropCapSpan: 0 , dropCapInset: 0 pt }, justification: ts. JustificationPolicy { mode: ts. JustificationMode . Unjustified (), minGapCount: 0 , minLineWidthRatioM: 0 , minFinalLineWidthRatioM: None(), maxAdjustment: 0 pt, maxGapAdjustment: 0 pt, maxGapRatioR: 0 , latinSpacing: None(), cjkStretchRatio: 0.0 }, costModel: ts. CostModel . FixedPoint (), knuthPlass: ts. KnuthPlassPolicy { toleranceR: 100000000 , linePenalty: 10 , fitnessDemerit: 0 , flaggedDemerit: 0 , finalFlaggedDemerit: 0 } } match (ts. breakParagraph (input)) { case Err( NoGreedyPlan ()) => io. writeLine ( "NoGreedyPlan" ) case _ => io. writeLine ( "unexpected result" ) } Expected output Exit code 0
NoGreedyPlan
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Report three forced soft hyphens in a row run · running · Verification · not-run
main.tpz Report three forced soft hyphens in a row import std.typeset as ts import std.io let items: Array < ts. Item > = [ ts. Item . BoxItem (ts. Box { unitIndex: 0 , text: "a" , width: 1 pt, trackingAfter: 0 pt }), ts. Item . PenaltyItem (ts. Penalty { unitEnd: 1 , width: 0 pt, rule: ts. BreakRule . Forced (), kind: ts. BreakKind . LatinSoftHyphen (), flagged: false }), ts. Item . BoxItem (ts. Box { unitIndex: 1 , text: "a" , width: 1 pt, trackingAfter: 0 pt }), ts. Item . PenaltyItem (ts. Penalty { unitEnd: 2 , width: 0 pt, rule: ts. BreakRule . Forced (), kind: ts. BreakKind . LatinSoftHyphen (), flagged: false }), ts. Item . BoxItem (ts. Box { unitIndex: 2 , text: "a" , width: 1 pt, trackingAfter: 0 pt }), ts. Item . PenaltyItem (ts. Penalty { unitEnd: 3 , width: 0 pt, rule: ts. BreakRule . Forced (), kind: ts. BreakKind . LatinSoftHyphen (), flagged: false }) ] let input = ts. Paragraph { grid: ts. DistanceGrid . MilliPoint (), items: items, geometry: ts. LineGeometry { bodyTarget: 1 pt, firstTarget: 1 pt, dropCapSpan: 0 , dropCapInset: 0 pt }, justification: ts. JustificationPolicy { mode: ts. JustificationMode . Unjustified (), minGapCount: 0 , minLineWidthRatioM: 0 , minFinalLineWidthRatioM: None(), maxAdjustment: 0 pt, maxGapAdjustment: 0 pt, maxGapRatioR: 0 , latinSpacing: None(), cjkStretchRatio: 0.0 }, costModel: ts. CostModel . FixedPoint (), knuthPlass: ts. KnuthPlassPolicy { toleranceR: 100000000 , linePenalty: 10 , fitnessDemerit: 0 , flaggedDemerit: 0 , finalFlaggedDemerit: 0 } } match (ts. breakParagraph (input)) { case Err( NoPlan ()) => io. writeLine ( "NoPlan" ) case _ => io. writeLine ( "unexpected result" ) } Expected output Exit code 0
NoPlan
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Alternatives considered Promise optimality without a search scope. The reader could not tell which candidates the result had been compared against.Why A program can compare both results from the same call.
Changed rules Choose deterministic paragraph plans →
Typesetting rejects negative extents while permitting negative tracking Adopted November 7, 2026 · 6.0.0 · In progress
Problem Width and tracking are both distances, but a negative value means different things in each. Ignoring negative width hides how the line was measured.
Decision Reject negative physical extents, penalty widths and drop-cap insets. Allow signed tracking.
Examples
Reject negative widths and negative extents before tracking run · running · Verification · not-run
main.tpz Reject negative widths and negative extents before tracking import std.typeset as ts import std.io function report (items: Array < ts. Item > ) -> () { let input = ts. Paragraph { grid: ts. DistanceGrid . MilliPoint (), items: items, geometry: ts. LineGeometry { bodyTarget: 10 pt, firstTarget: 10 pt, dropCapSpan: 0 , dropCapInset: 0 pt }, justification: ts. JustificationPolicy { mode: ts. JustificationMode . Unjustified (), minGapCount: 0 , minLineWidthRatioM: 0 , minFinalLineWidthRatioM: None(), maxAdjustment: 0 pt, maxGapAdjustment: 0 pt, maxGapRatioR: 0 , latinSpacing: None(), cjkStretchRatio: 0.0 }, costModel: ts. CostModel . FixedPoint (), knuthPlass: ts. KnuthPlassPolicy { toleranceR: 100000000 , linePenalty: 10 , fitnessDemerit: 0 , flaggedDemerit: 0 , finalFlaggedDemerit: 0 } } match (ts. breakParagraph (input)) { case Err( InvalidInput (_)) => io. writeLine ( "InvalidInput" ) case _ => io. writeLine ( "unexpected result" ) } } report ([ts. Item . BoxItem (ts. Box { unitIndex: 0 , text: "a" , width: - 1 pt, trackingAfter: 0 pt }), ts. Item . PenaltyItem (ts. Penalty { unitEnd: 1 , width: 0 pt, rule: ts. BreakRule . Forced (), kind: ts. BreakKind . ForcedEnd (), flagged: false })]) report ([ts. Item . GlueItem (ts. Glue { unitIndex: 0 , text: " " , width: - 1 pt, trackingAfter: 0 pt, stretch: 0 pt, shrink: 0 pt }), ts. Item . PenaltyItem (ts. Penalty { unitEnd: 1 , width: 0 pt, rule: ts. BreakRule . Forced (), kind: ts. BreakKind . ForcedEnd (), flagged: false })]) report ([ts. Item . BoxItem (ts. Box { unitIndex: 0 , text: "a" , width: 1 pt, trackingAfter: 2 pt }), ts. Item . PenaltyItem (ts. Penalty { unitEnd: 1 , width: 0 pt, rule: ts. BreakRule . Forced (), kind: ts. BreakKind . ForcedEnd (), flagged: false })]) report ([ts. Item . GlueItem (ts. Glue { unitIndex: 0 , text: " " , width: 1 pt, trackingAfter: 2 pt, stretch: 0 pt, shrink: 0 pt }), ts. Item . PenaltyItem (ts. Penalty { unitEnd: 1 , width: 0 pt, rule: ts. BreakRule . Forced (), kind: ts. BreakKind . ForcedEnd (), flagged: false })]) Expected output Exit code 0
InvalidInput
InvalidInput
InvalidInput
InvalidInput
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout InvalidInput InvalidInput InvalidInput InvalidInput This exact example has not been executed.
Keep measured units and signed tracking in source order run · running · Verification · not-run
main.tpz Keep measured units and signed tracking in source order import std.typeset as ts import std.io let items: Array < ts. Item > = [ ts. Item . PenaltyItem (ts. Penalty { unitEnd: 3 , width: 0 pt, rule: ts. BreakRule . Forced (), kind: ts. BreakKind . ForcedEnd (), flagged: false }), ts. Item . BoxItem (ts. Box { unitIndex: 0 , text: "AB" , width: 3 pt, trackingAfter: 1 pt }), ts. Item . GlueItem (ts. Glue { unitIndex: 1 , text: " " , width: 2 pt, trackingAfter: 0.5 pt, stretch: 1 pt, shrink: 1 pt }), ts. Item . BoxItem (ts. Box { unitIndex: 2 , text: "C" , width: 4 pt, trackingAfter: - 1 pt }) ] let input = ts. Paragraph { grid: ts. DistanceGrid . MilliPoint (), items: items, geometry: ts. LineGeometry { bodyTarget: 10 pt, firstTarget: 10 pt, dropCapSpan: 0 , dropCapInset: 0 pt }, justification: ts. JustificationPolicy { mode: ts. JustificationMode . Unjustified (), minGapCount: 0 , minLineWidthRatioM: 0 , minFinalLineWidthRatioM: None(), maxAdjustment: 0 pt, maxGapAdjustment: 0 pt, maxGapRatioR: 0 , latinSpacing: None(), cjkStretchRatio: 0.0 }, costModel: ts. CostModel . FixedPoint (), knuthPlass: ts. KnuthPlassPolicy { toleranceR: 100000000 , linePenalty: 10 , fitnessDemerit: 0 , flaggedDemerit: 0 , finalFlaggedDemerit: 0 } } match (ts. breakParagraph (input)) { case Ok(result) => { let line = result.optimized.lines[ 0 ] io. writeLine ( "{line.start}:{line.endExclusive}:{line.displayTextScalarLength}" ) io. writeLine ( "{line.rawTextWidth == 10 pt}:{line.trimmedTextWidth == 10 pt}" ) io. writeLine ( "{items.length}" ) match (items[ 0 ]) { case PenaltyItem (_) => io. writeLine ( "penalty first" ) case _ => io. writeLine ( "changed input" ) } } case Err(_) => io. writeLine ( "unexpected error" ) } Expected output Exit code 0
0:3:4
true:true
4
penalty first
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout 0:3:4 true:true 4 penalty first This exact example has not been executed.
Reject a negative boundary width run · running · Verification · not-run
main.tpz Reject a negative boundary width import std.typeset as ts import std.io let items: Array < ts. Item > = [ ts. Item . BoxItem (ts. Box { unitIndex: 0 , text: "a" , width: 1 pt, trackingAfter: 0 pt }), ts. Item . PenaltyItem (ts. Penalty { unitEnd: 1 , width: - 1 pt, rule: ts. BreakRule . Forced (), kind: ts. BreakKind . ForcedEnd (), flagged: false }) ] let input = ts. Paragraph { grid: ts. DistanceGrid . MilliPoint (), items: items, geometry: ts. LineGeometry { bodyTarget: 10 pt, firstTarget: 10 pt, dropCapSpan: 0 , dropCapInset: 0 pt }, justification: ts. JustificationPolicy { mode: ts. JustificationMode . Unjustified (), minGapCount: 0 , minLineWidthRatioM: 0 , minFinalLineWidthRatioM: None(), maxAdjustment: 0 pt, maxGapAdjustment: 0 pt, maxGapRatioR: 0 , latinSpacing: None(), cjkStretchRatio: 0.0 }, costModel: ts. CostModel . FixedPoint (), knuthPlass: ts. KnuthPlassPolicy { toleranceR: 100000000 , linePenalty: 10 , fitnessDemerit: 0 , flaggedDemerit: 0 , finalFlaggedDemerit: 0 } } match (ts. breakParagraph (input)) { case Err( InvalidInput (_)) => io. writeLine ( "InvalidInput" ) case _ => io. writeLine ( "unexpected result" ) } Expected output Exit code 0
InvalidInput
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Reject a negative drop cap inset run · running · Verification · not-run
main.tpz Reject a negative drop cap inset import std.typeset as ts import std.io let items: Array < ts. Item > = [ ts. Item . BoxItem (ts. Box { unitIndex: 0 , text: "a" , width: 1 pt, trackingAfter: 0 pt }), ts. Item . PenaltyItem (ts. Penalty { unitEnd: 1 , width: 0 pt, rule: ts. BreakRule . Forced (), kind: ts. BreakKind . ForcedEnd (), flagged: false }) ] let input = ts. Paragraph { grid: ts. DistanceGrid . MilliPoint (), items: items, geometry: ts. LineGeometry { bodyTarget: 10 pt, firstTarget: 10 pt, dropCapSpan: 1 , dropCapInset: - 1 pt }, justification: ts. JustificationPolicy { mode: ts. JustificationMode . Unjustified (), minGapCount: 0 , minLineWidthRatioM: 0 , minFinalLineWidthRatioM: None(), maxAdjustment: 0 pt, maxGapAdjustment: 0 pt, maxGapRatioR: 0 , latinSpacing: None(), cjkStretchRatio: 0.0 }, costModel: ts. CostModel . FixedPoint (), knuthPlass: ts. KnuthPlassPolicy { toleranceR: 100000000 , linePenalty: 10 , fitnessDemerit: 0 , flaggedDemerit: 0 , finalFlaggedDemerit: 0 } } match (ts. breakParagraph (input)) { case Err( InvalidPolicy (_)) => io. writeLine ( "InvalidPolicy" ) case _ => io. writeLine ( "unexpected result" ) } Expected output Exit code 0
InvalidPolicy
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Alternatives considered Allow or ignore negative physical widths. An invalid measurement could pass unnoticed.Why Readers can distinguish intentional tightening from an invalid physical extent.
Changed rules Preserve measured units and validate their physical extents →Apply penalties at measured unit boundaries →Compute each line target from one geometry →
Selected penalty width contributes to line width Adopted November 7, 2026 · 6.0.0 · In progress
Problem A line break can add visible material with a width. Different cost methods could measure the same line differently if they count that material differently.
Decision Include a selected penalty's width for every kind in both cost methods and in the natural width used for justification.
Examples
Include a selected nonsoft penalty width with fixed costs run · running · Verification · not-run
main.tpz Include a selected nonsoft penalty width with fixed costs import std.typeset as ts import std.io let items: Array < ts. Item > = [ ts. Item . BoxItem (ts. Box { unitIndex: 0 , text: "a" , width: 4 pt, trackingAfter: 0 pt }), ts. Item . PenaltyItem (ts. Penalty { unitEnd: 1 , width: 1 pt, rule: ts. BreakRule . Forced (), kind: ts. BreakKind . LatinHyphen (), flagged: false }) ] let input = ts. Paragraph { grid: ts. DistanceGrid . MilliPoint (), items: items, geometry: ts. LineGeometry { bodyTarget: 5 pt, firstTarget: 5 pt, dropCapSpan: 0 , dropCapInset: 0 pt }, justification: ts. JustificationPolicy { mode: ts. JustificationMode . Unjustified (), minGapCount: 0 , minLineWidthRatioM: 0 , minFinalLineWidthRatioM: None(), maxAdjustment: 0 pt, maxGapAdjustment: 0 pt, maxGapRatioR: 0 , latinSpacing: None(), cjkStretchRatio: 0.0 }, costModel: ts. CostModel . FixedPoint (), knuthPlass: ts. KnuthPlassPolicy { toleranceR: 100000000 , linePenalty: 10 , fitnessDemerit: 0 , flaggedDemerit: 0 , finalFlaggedDemerit: 0 } } match (ts. breakParagraph (input)) { case Ok(result) => { let line = result.optimized.lines[ 0 ] io. writeLine ( "{line.selectedPenaltyWidth == 1 pt}:{line.costTextWidth == 4 pt}:{line.cost}" ) } case Err(_) => io. writeLine ( "unexpected error" ) } Expected output Exit code 0
true:true:350000000
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Include a selected nonsoft penalty width with knuth costs run · running · Verification · not-run
main.tpz Include a selected nonsoft penalty width with knuth costs import std.typeset as ts import std.io let items: Array < ts. Item > = [ ts. Item . BoxItem (ts. Box { unitIndex: 0 , text: "a" , width: 4 pt, trackingAfter: 0 pt }), ts. Item . PenaltyItem (ts. Penalty { unitEnd: 1 , width: 1 pt, rule: ts. BreakRule . Forced (), kind: ts. BreakKind . LatinHyphen (), flagged: false }) ] let input = ts. Paragraph { grid: ts. DistanceGrid . MilliPoint (), items: items, geometry: ts. LineGeometry { bodyTarget: 5 pt, firstTarget: 5 pt, dropCapSpan: 0 , dropCapInset: 0 pt }, justification: ts. JustificationPolicy { mode: ts. JustificationMode . Unjustified (), minGapCount: 0 , minLineWidthRatioM: 0 , minFinalLineWidthRatioM: None(), maxAdjustment: 0 pt, maxGapAdjustment: 0 pt, maxGapRatioR: 0 , latinSpacing: None(), cjkStretchRatio: 0.0 }, costModel: ts. CostModel . KnuthPlass (), knuthPlass: ts. KnuthPlassPolicy { toleranceR: 100000000 , linePenalty: 10 , fitnessDemerit: 0 , flaggedDemerit: 0 , finalFlaggedDemerit: 0 } } match (ts. breakParagraph (input)) { case Ok(result) => { let line = result.optimized.lines[ 0 ] io. writeLine ( "{line.selectedPenaltyWidth == 1 pt}:{line.costTextWidth == 4 pt}:{line.cost}" ) } case Err(_) => io. writeLine ( "unexpected error" ) } Expected output Exit code 0
true:true:100
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Include an inserted width in justification without adding gaps run · running · Verification · not-run
main.tpz Include an inserted width in justification without adding gaps import std.typeset as ts import std.io import std.test function sample (textWidth: Length < Pt > , insertionWidth: Length < Pt > ) -> ts. ParagraphResult { let items: Array < ts. Item > = [ ts. Item . BoxItem (ts. Box { unitIndex: 0 , text: "a" , width: textWidth, trackingAfter: 0 pt }), ts. Item . PenaltyItem (ts. Penalty { unitEnd: 1 , width: insertionWidth, rule: ts. BreakRule . Forced (), kind: ts. BreakKind . LatinHyphen (), flagged: false }), ts. Item . BoxItem (ts. Box { unitIndex: 1 , text: "tail" , width: 5 pt, trackingAfter: 0 pt }), ts. Item . PenaltyItem (ts. Penalty { unitEnd: 2 , width: 0 pt, rule: ts. BreakRule . Forced (), kind: ts. BreakKind . ForcedEnd (), flagged: false }) ] let input = ts. Paragraph { grid: ts. DistanceGrid . MilliPoint (), items: items, geometry: ts. LineGeometry { bodyTarget: 5 pt, firstTarget: 5 pt, dropCapSpan: 0 , dropCapInset: 0 pt }, justification: ts. JustificationPolicy { mode: ts. JustificationMode . LatinWordSpace (), minGapCount: 0 , minLineWidthRatioM: 1000 , minFinalLineWidthRatioM: None(), maxAdjustment: 0 pt, maxGapAdjustment: 0 pt, maxGapRatioR: 0 , latinSpacing: None(), cjkStretchRatio: 0.0 }, costModel: ts. CostModel . FixedPoint (), knuthPlass: ts. KnuthPlassPolicy { toleranceR: 100000000 , linePenalty: 10 , fitnessDemerit: 0 , flaggedDemerit: 0 , finalFlaggedDemerit: 0 } } test. assertOk (ts. breakParagraph (input)) } let inserted = sample ( 4 pt, 1 pt) let measured = sample ( 5 pt, 0 pt) io. writeLine ( "{inserted.optimized.lines[ 0 ].cost == measured.optimized.lines[ 0 ].cost}" ) Expected output Exit code 0
true
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Alternatives considered Ignore width for some penalty kinds. The same inserted material would count in only some line calculations.Why Break selection and justification use the same physical width.
Changed rules Apply penalties at measured unit boundaries →Score justification with explicit policy precedence →
The final-line minimum applies only to the last FixedPoint line Adopted November 7, 2026 · 6.0.0 · In progress
Problem Adjusting the last line could change preceding lines if they read the same setting. Falling short of a width target should also leave the shortage nonnegative.
Decision Apply min Final Line Width Ratio M only when calculating the final FixedPoint line. Keep the shortage nonnegative even for a large minimum. Falling below the target does not lower the cost. Examples
Apply the final line threshold to the final line run · running · Verification · not-run
main.tpz Apply the final line threshold to the final line import std.typeset as ts import std.io import std.test function sample (justification: ts. JustificationPolicy ) -> ts. ParagraphResult { let items: Array < ts. Item > = [ ts. Item . BoxItem (ts. Box { unitIndex: 0 , text: "word" , width: 10 pt, trackingAfter: 0 pt }), ts. Item . PenaltyItem (ts. Penalty { unitEnd: 1 , width: 0 pt, rule: ts. BreakRule . Forced (), kind: ts. BreakKind . ForcedEnd (), flagged: false }) ] let input = ts. Paragraph { grid: ts. DistanceGrid . MilliPoint (), items: items, geometry: ts. LineGeometry { bodyTarget: 20 pt, firstTarget: 20 pt, dropCapSpan: 0 , dropCapInset: 0 pt }, justification: justification, costModel: ts. CostModel . FixedPoint (), knuthPlass: ts. KnuthPlassPolicy { toleranceR: 100000000 , linePenalty: 10 , fitnessDemerit: 0 , flaggedDemerit: 0 , finalFlaggedDemerit: 0 } } test. assertOk (ts. breakParagraph (input)) } let unconstrained = sample (ts. JustificationPolicy { mode: ts. JustificationMode . LatinWordSpace (), minGapCount: 0 , minLineWidthRatioM: 0 , minFinalLineWidthRatioM: None(), maxAdjustment: 0 pt, maxGapAdjustment: 0 pt, maxGapRatioR: 0 , latinSpacing: None(), cjkStretchRatio: 0.0 }) let constrained = sample (ts. JustificationPolicy { mode: ts. JustificationMode . LatinWordSpace (), minGapCount: 0 , minLineWidthRatioM: 0 , minFinalLineWidthRatioM: Some( 1000 ), maxAdjustment: 0 pt, maxGapAdjustment: 0 pt, maxGapRatioR: 0 , latinSpacing: None(), cjkStretchRatio: 0.0 }) io. writeLine ( "{constrained.optimized.lines[ 0 ].cost > unconstrained.optimized.lines[ 0 ].cost}" ) Expected output Exit code 0
true
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Keep the final line threshold out of nonfinal scoring run · running · Verification · not-run
main.tpz Keep the final line threshold out of nonfinal scoring import std.typeset as ts import std.io import std.test function sample (justification: ts. JustificationPolicy ) -> ts. ParagraphResult { let items: Array < ts. Item > = [ ts. Item . BoxItem (ts. Box { unitIndex: 0 , text: "word" , width: 4 pt, trackingAfter: 0 pt }), ts. Item . PenaltyItem (ts. Penalty { unitEnd: 1 , width: 0 pt, rule: ts. BreakRule . Forced (), kind: ts. BreakKind . ForcedEnd (), flagged: false }), ts. Item . BoxItem (ts. Box { unitIndex: 1 , text: "next" , width: 4 pt, trackingAfter: 0 pt }), ts. Item . PenaltyItem (ts. Penalty { unitEnd: 2 , width: 0 pt, rule: ts. BreakRule . Forced (), kind: ts. BreakKind . ForcedEnd (), flagged: false }) ] let input = ts. Paragraph { grid: ts. DistanceGrid . MilliPoint (), items: items, geometry: ts. LineGeometry { bodyTarget: 10 pt, firstTarget: 10 pt, dropCapSpan: 0 , dropCapInset: 0 pt }, justification: justification, costModel: ts. CostModel . FixedPoint (), knuthPlass: ts. KnuthPlassPolicy { toleranceR: 100000000 , linePenalty: 10 , fitnessDemerit: 0 , flaggedDemerit: 0 , finalFlaggedDemerit: 0 } } test. assertOk (ts. breakParagraph (input)) } let ordinary = sample (ts. JustificationPolicy { mode: ts. JustificationMode . LatinWordSpace (), minGapCount: 1 , minLineWidthRatioM: 0 , minFinalLineWidthRatioM: None(), maxAdjustment: 0 pt, maxGapAdjustment: 0 pt, maxGapRatioR: 0 , latinSpacing: None(), cjkStretchRatio: 0.0 }) let finalZero = sample (ts. JustificationPolicy { mode: ts. JustificationMode . LatinWordSpace (), minGapCount: 1 , minLineWidthRatioM: 0 , minFinalLineWidthRatioM: Some( 0 ), maxAdjustment: 0 pt, maxGapAdjustment: 0 pt, maxGapRatioR: 0 , latinSpacing: None(), cjkStretchRatio: 0.0 }) io. writeLine ( "{ordinary.optimized.lines[ 0 ].cost == finalZero.optimized.lines[ 0 ].cost}" ) Expected output Exit code 0
true
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Raise the score when an overwide unit misses a larger minimum run · running · Verification · not-run
main.tpz Raise the score when an overwide unit misses a larger minimum import std.typeset as ts import std.io import std.test function sample (ratio: int ) -> ts. ParagraphResult { let items: Array < ts. Item > = [ ts. Item . BoxItem (ts. Box { unitIndex: 0 , text: "wide" , width: 1.5 pt, trackingAfter: 0 pt }), ts. Item . PenaltyItem (ts. Penalty { unitEnd: 1 , width: 0 pt, rule: ts. BreakRule . Forced (), kind: ts. BreakKind . ForcedEnd (), flagged: false }), ts. Item . BoxItem (ts. Box { unitIndex: 1 , text: "end" , width: 1 pt, trackingAfter: 0 pt }), ts. Item . PenaltyItem (ts. Penalty { unitEnd: 2 , width: 0 pt, rule: ts. BreakRule . Forced (), kind: ts. BreakKind . ForcedEnd (), flagged: false }) ] let input = ts. Paragraph { grid: ts. DistanceGrid . MilliPoint (), items: items, geometry: ts. LineGeometry { bodyTarget: 1 pt, firstTarget: 1 pt, dropCapSpan: 0 , dropCapInset: 0 pt }, justification: ts. JustificationPolicy { mode: ts. JustificationMode . LatinWordSpace (), minGapCount: 0 , minLineWidthRatioM: ratio, minFinalLineWidthRatioM: None(), maxAdjustment: 0 pt, maxGapAdjustment: 0 pt, maxGapRatioR: 0 , latinSpacing: None(), cjkStretchRatio: 0.0 }, costModel: ts. CostModel . FixedPoint (), knuthPlass: ts. KnuthPlassPolicy { toleranceR: 100000000 , linePenalty: 10 , fitnessDemerit: 0 , flaggedDemerit: 0 , finalFlaggedDemerit: 0 } } test. assertOk (ts. breakParagraph (input)) } let ordinary = sample ( 0 ) let thresholded = sample ( 2000 ) io. writeLine ( "{thresholded.optimized.lines[ 0 ].cost > ordinary.optimized.lines[ 0 ].cost}" ) Expected output Exit code 0
true
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Alternatives considered Read the final-line setting for earlier lines as well. A setting meant for the last line would change the rest of the paragraph.Why The setting has a defined effect on the line it names.
Changed rules Score justification with explicit policy precedence →
Consumer artifacts use inspectConsumerArtifact Adopted November 7, 2026 · 6.0.0 · In progress
Problem Two functions provided the same consumer artifact information. Their names gave callers two choices for the same action.
Decision Keep inspect Consumer Artifact and remove the equivalent verify Consumer Artifact.
Alternatives considered Keep both names. Callers would still have two names for a single operation.Why There is one public function for inspecting a consumer artifact.
Changed rules Inspect and validate consumer artifacts in one call →
Lispex evaluation is distinct from admission and evidence work Adopted November 8, 2026 · 6.0.0 · Being verified
Problem An evaluation can be surrounded by checks before execution and evidence checks afterward. Putting them in one call obscures where an outcome came from.
Decision The 6.0 API distinguishes canonical evaluation, admission, host interruption and additional evidence work.
Alternatives considered Fold admission and evidence into the evaluation call. Callers could not tell as directly which step succeeded or failed.Why The caller can run the needed operations and handle evaluation separately.
Changed rules Pass values through a bounded guest boundary →Read a completed evaluation and preserve its failure class →Keep portable receipts, profile work, and authentication distinct →
A Lispex request is an immutable snapshot once identified Adopted November 8, 2026 · 6.0.0 · Being verified
Problem A host can change a value after using it to form a request. Reusing the same identity for different input would make that request unstable.
Decision Canonical byte exchange and host Datum construction preserve exact values within explicit conversion budgets. An identified request is an immutable snapshot.
Alternatives considered Share the host value directly. A request identity could refer to a value that changed later.Why The same input can be checked when executing or replaying an identified request.
Changed rules Exchange exact immutable Datum values →
A Lispex package becomes usable after admission Adopted November 8, 2026 · 6.0.0 · Being verified
Problem A package has required components and resource contracts. Discovering a missing input on the first call delays failure until use.
Decision Verify every supplied component and resource contract before returning a usable package handle.
Alternatives considered Discover components on every call. Each call would decide again whether the same package is complete and usable.Why Callers receive a checked package before starting follow-up work.
Changed rules Admit complete packages without ambient authority →
Transported Lispex code goes through admission again Adopted November 8, 2026 · 6.0.0 · Being verified
Problem A rule prepared in one environment can travel to another. Preparation alone does not establish what bytes arrived.
Decision Preparation produces an immutable verified rule under its own finite budget. Transported code always goes through admission again.
Alternatives considered Trust transported code because it was prepared earlier. The receiver could not establish that it received the same validated input.Why Preparation and transport have explicit verification boundaries.
Changed rules Prepare closed source and revalidate transported rules →
Lispex distinguishes completed evaluation from a failed attempt Adopted November 8, 2026 · 6.0.0 · Being verified
Problem An evaluation can finish with a language error, or be prevented from finishing at all. A caller needs to tell those cases apart.
Decision A completed evaluation returns the canonical settlement. Admission or execution that prevents completion returns a separate attempt error.
Alternatives considered Mix every report into the settlement. The result shape would not tell the caller whether evaluation completed.Why Callers can handle a completed evaluation differently from an unsuccessful attempt.
Changed rules Read a completed evaluation and preserve its failure class →
Lispex uses distinct identities for requests, sources and execution Adopted November 8, 2026 · 6.0.0 · Being verified
Problem The same request can come from a different source or run with different engine bytes. One combined identity hides which part changed.
Decision Give semantic requests, source provenance, engine bytes and profile host work distinct typed identities.
Alternatives considered Combine all identity domains into one. A change in the request would be hard to distinguish from a change in its surroundings.Why Request equality and execution provenance can be checked separately.
Changed rules Identify source, programs, requests, artifacts, and profile work →
Lispex replay checks a new result against the recorded result Adopted November 8, 2026 · 6.0.0 · Being verified
Problem Replaying a stored evaluation requires checking that the request is the one intended. It answers a different question from artifact inspection or authentication.
Decision fresh Replay verifies the stored request before execution and succeeds when the new settlement matches the recorded one.
Alternatives considered Combine replay, artifact inspection and authentication. The outcome of rerunning the request would be mixed with the outcome of external checks.Why The replay establishes which request was run and whether its result matched.
Changed rules Replay a complete request and compare the whole outcome →
Lispex evaluation results survive follow-up verification Adopted November 8, 2026 · 6.0.0 · Being verified
Problem A caller can check a profile or artifact after evaluation. Failure of that check need not change the language outcome already obtained.
Decision Keep the canonical evaluation result and report profile qualification, artifact verification and issuer authentication separately.
Alternatives considered Erase the language outcome when a follow-up check rejects. The caller could not distinguish evaluation from a separate verification decision.Why The result remains available with a clear report of the check that failed.
Changed rules Keep portable receipts, profile work, and authentication distinct →
Lispex phases use separate finite resource limits Adopted November 8, 2026 · 6.0.0 · Being verified
Problem Preparation, evaluation and host work can consume different resources. A single limit obscures which phase exceeded its budget first.
Decision Use complete finite limit records for preparation, evaluation and host work. Preserve the first resource failure in the defined order.
Alternatives considered Share one limit across phases. The failing phase and its exhausted budget would be hard to identify.Why A resource failure can be traced to its stage and limits.
Changed rules Apply finite budgets in the declared resource order →
Lispex factories produce ordinary immutable rules Adopted November 8, 2026 · 6.0.0 · Being verified
Problem A generated factory needs known inputs and bounds when it creates a rule. A caller also needs to run the result like a handwritten rule.
Decision Use verified lock entries and explicit preparation limits to produce the standard immutable rule form.
Alternatives considered Give factory-produced rules separate evaluation semantics. The same rule would execute differently depending on how it was made.Why Prepared rules use the same evaluation path regardless of how they were created.
Changed rules Resolve generated factories through the admitted lock →
Strings can be split into grapheme clusters Adopted November 7, 2026 · 6.0.0 · In progress
Problem One visible character can include more than one code point. Iterating over scalars can split it in the middle.
Decision string. graphemes() splits a string into an array using Unicode 16 grapheme boundaries.Scalar operations remain available. Splitting does not normalize the underlying string data. Examples
Segment combining text, Hangul, and emoji run · running · Verification · not-run
main.tpz Segment combining text, Hangul, and emoji import std.io let text = "é가👩💻🇰🇷" let clusters: Array < string > = text. graphemes () io. writeLine ( "{text. scalars ().length}:{clusters.length}" ) io. writeLine (clusters. join ( "|" )) io. writeLine ( "{clusters. join ("") == text}" ) Expected output Exit code 0
9:4
é|가|👩💻|🇰🇷
true
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Keep empty text, CRLF, leading marks, and odd regional indicators distinct run · running · Verification · not-run
main.tpz Keep empty text, CRLF, leading marks, and odd regional indicators distinct import std.io for text in ([ "" , "\r\n" , "̈́A" , "🇰🇷🇯" ]) { let clusters = text. graphemes () io. writeLine ( "{clusters.length}:{clusters. join ("") == text}" ) } Expected output Exit code 0
0:true
1:true
2:true
2:true
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Preserve decomposed and precomposed text exactly run · running · Verification · not-run
main.tpz Preserve decomposed and precomposed text exactly import std.io let decomposed = "é" let precomposed = "é" let text = decomposed + precomposed let clusters = text. graphemes () io. writeLine ( "{clusters.length}" ) io. writeLine ( "{clusters[ 0 ] == decomposed}" ) io. writeLine ( "{clusters[ 1 ] == precomposed}" ) io. writeLine ( "{clusters. join ("") == text}" ) io. writeLine ( "{decomposed == precomposed}" ) Expected output Exit code 0
2
true
true
true
false
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
run · running · Verification · not-run
main.tpz Check every published Unicode 16 grapheme test row import std.io import graphemecases0 import graphemecases1 import graphemecases2 import graphemecases3 import graphemecases4 import graphemecases5 import graphemecases6 import graphemecases7 import graphemecases8 import graphemecases9 import graphemecases10 import graphemecases11 import graphemecases12 import graphemecases13 import graphemecases14 import graphemecases15 import graphemecases16 import graphemecases17 let mut failures = 0 failures += graphemecases0. run () failures += graphemecases1. run () failures += graphemecases2. run () failures += graphemecases3. run () failures += graphemecases4. run () failures += graphemecases5. run () failures += graphemecases6. run () failures += graphemecases7. run () failures += graphemecases8. run () failures += graphemecases9. run () failures += graphemecases10. run () failures += graphemecases11. run () failures += graphemecases12. run () failures += graphemecases13. run () failures += graphemecases14. run () failures += graphemecases15. run () failures += graphemecases16. run () failures += graphemecases17. run () if (failures == 0 ) { io. writeLine ( "Unicode 16.0.0 grapheme corpus passed" ) } Expected output Exit code 0
Unicode 16.0.0 grapheme corpus passed
graphemesupport.tpz Check every published Unicode 16 grapheme test row import std.io function agrees (input: string , expected: Array < string > ) -> bool { let actual: Array < string > = input. graphemes () if (actual.length != expected.length) { return false } if (actual. join ( "" ) != input) { return false } for index in ( 0 ..< expected.length) { if (actual[index] != expected[index]) { return false } } true } export function checkCase (line: int , input: string , expected: Array < string > ) -> int { if ( agrees (input, expected)) { return 0 } io. writeLine ( "GraphemeBreakTest line {line} failed" ) 1 } graphemecases0.tpz Check every published Unicode 16 grapheme test row import graphemesupport { checkCase } export function run () -> int { let mut failures = 0 failures += checkCase ( 25 , " " , [ " " , " " ]) failures += checkCase ( 26 , " ̈ " , [ " ̈" , " " ]) failures += checkCase ( 27 , " \r" , [ " " , "\r" ]) failures += checkCase ( 28 , " ̈\r" , [ " ̈" , "\r" ]) failures += checkCase ( 29 , " \n" , [ " " , "\n" ]) failures += checkCase ( 30 , " ̈\n" , [ " ̈" , "\n" ]) failures += checkCase ( 31 , " " , [ " " , "" ]) failures += checkCase ( 32 , " ̈" , [ " ̈" , "" ]) failures += checkCase ( 33 , " " , [ " " ]) failures += checkCase ( 34 , " ̈" , [ " ̈" ]) failures += checkCase ( 35 , " 🇦" , [ " " , "🇦" ]) failures += checkCase ( 36 , " ̈🇦" , [ " ̈" , "🇦" ]) failures += checkCase ( 37 , " " , [ " " , "" ]) failures += checkCase ( 38 , " ̈" , [ " ̈" , "" ]) failures += checkCase ( 39 , " ਃ" , [ " ਃ" ]) failures += checkCase ( 40 , " ̈ਃ" , [ " ̈ਃ" ]) failures += checkCase ( 41 , " ᄀ" , [ " " , "ᄀ" ]) failures += checkCase ( 42 , " ̈ᄀ" , [ " ̈" , "ᄀ" ]) failures += checkCase ( 43 , " ᅠ" , [ " " , "ᅠ" ]) failures += checkCase ( 44 , " ̈ᅠ" , [ " ̈" , "ᅠ" ]) failures += checkCase ( 45 , " ᆨ" , [ " " , "ᆨ" ]) failures += checkCase ( 46 , " ̈ᆨ" , [ " ̈" , "ᆨ" ]) failures += checkCase ( 47 , " 가" , [ " " , "가" ]) failures += checkCase ( 48 , " ̈가" , [ " ̈" , "가" ]) failures += checkCase ( 49 , " 각" , [ " " , "각" ]) failures += checkCase ( 50 , " ̈각" , [ " ̈" , "각" ]) failures += checkCase ( 51 , " ः" , [ " ः" ]) failures += checkCase ( 52 , " ̈ः" , [ " ̈ः" ]) failures += checkCase ( 53 , " ऄ" , [ " " , "ऄ" ]) failures += checkCase ( 54 , " ̈ऄ" , [ " ̈" , "ऄ" ]) failures += checkCase ( 55 , " ൎ" , [ " " , "ൎ" ]) failures += checkCase ( 56 , " ̈ൎ" , [ " ̈" , "ൎ" ]) failures += checkCase ( 57 , " क" , [ " " , "क" ]) failures += checkCase ( 58 , " ̈क" , [ " ̈" , "क" ]) failures += checkCase ( 59 , " ⌚" , [ " " , "⌚" ]) failures += checkCase ( 60 , " ̈⌚" , [ " ̈" , "⌚" ]) failures += checkCase ( 61 , " ̀" , [ " ̀" ]) failures += checkCase ( 62 , " ̈̀" , [ " ̈̀" ]) failures += checkCase ( 63 , " ऀ" , [ " ऀ" ]) failures += checkCase ( 64 , " ̈ऀ" , [ " ̈ऀ" ]) failures += checkCase ( 65 , " ्" , [ " ्" ]) failures += checkCase ( 66 , " ्̈" , [ " ्̈" ]) failures += checkCase ( 67 , " " , [ " " ]) failures += checkCase ( 68 , " ̈" , [ " ̈" ]) failures += checkCase ( 69 , " " , [ " " , "" ]) failures += checkCase ( 70 , " ̈" , [ " ̈" , "" ]) failures += checkCase ( 71 , "\r " , [ "\r" , " " ]) failures += checkCase ( 72 , "\r̈ " , [ "\r" , "̈" , " " ]) failures += checkCase ( 73 , "\r\r" , [ "\r" , "\r" ]) failures += checkCase ( 74 , "\r̈\r" , [ "\r" , "̈" , "\r" ]) failures += checkCase ( 75 , "\r\n" , [ "\r\n" ]) failures += checkCase ( 76 , "\r̈\n" , [ "\r" , "̈" , "\n" ]) failures += checkCase ( 77 , "\r" , [ "\r" , "" ]) failures += checkCase ( 78 , "\r̈" , [ "\r" , "̈" , "" ]) failures += checkCase ( 79 , "\r" , [ "\r" , "" ]) failures += checkCase ( 80 , "\r̈" , [ "\r" , "̈" ]) failures += checkCase ( 81 , "\r🇦" , [ "\r" , "🇦" ]) failures += checkCase ( 82 , "\r̈🇦" , [ "\r" , "̈" , "🇦" ]) failures += checkCase ( 83 , "\r" , [ "\r" , "" ]) failures += checkCase ( 84 , "\r̈" , [ "\r" , "̈" , "" ]) failures += checkCase ( 85 , "\rਃ" , [ "\r" , "ਃ" ]) failures += checkCase ( 86 , "\r̈ਃ" , [ "\r" , "̈ਃ" ]) failures += checkCase ( 87 , "\rᄀ" , [ "\r" , "ᄀ" ]) failures += checkCase ( 88 , "\r̈ᄀ" , [ "\r" , "̈" , "ᄀ" ]) failures } graphemecases1.tpz Check every published Unicode 16 grapheme test row import graphemesupport { checkCase } export function run () -> int { let mut failures = 0 failures += checkCase ( 89 , "\rᅠ" , [ "\r" , "ᅠ" ]) failures += checkCase ( 90 , "\r̈ᅠ" , [ "\r" , "̈" , "ᅠ" ]) failures += checkCase ( 91 , "\rᆨ" , [ "\r" , "ᆨ" ]) failures += checkCase ( 92 , "\r̈ᆨ" , [ "\r" , "̈" , "ᆨ" ]) failures += checkCase ( 93 , "\r가" , [ "\r" , "가" ]) failures += checkCase ( 94 , "\r̈가" , [ "\r" , "̈" , "가" ]) failures += checkCase ( 95 , "\r각" , [ "\r" , "각" ]) failures += checkCase ( 96 , "\r̈각" , [ "\r" , "̈" , "각" ]) failures += checkCase ( 97 , "\rः" , [ "\r" , "ः" ]) failures += checkCase ( 98 , "\r̈ः" , [ "\r" , "̈ः" ]) failures += checkCase ( 99 , "\rऄ" , [ "\r" , "ऄ" ]) failures += checkCase ( 100 , "\r̈ऄ" , [ "\r" , "̈" , "ऄ" ]) failures += checkCase ( 101 , "\rൎ" , [ "\r" , "ൎ" ]) failures += checkCase ( 102 , "\r̈ൎ" , [ "\r" , "̈" , "ൎ" ]) failures += checkCase ( 103 , "\rक" , [ "\r" , "क" ]) failures += checkCase ( 104 , "\r̈क" , [ "\r" , "̈" , "क" ]) failures += checkCase ( 105 , "\r⌚" , [ "\r" , "⌚" ]) failures += checkCase ( 106 , "\r̈⌚" , [ "\r" , "̈" , "⌚" ]) failures += checkCase ( 107 , "\r̀" , [ "\r" , "̀" ]) failures += checkCase ( 108 , "\r̈̀" , [ "\r" , "̈̀" ]) failures += checkCase ( 109 , "\rऀ" , [ "\r" , "ऀ" ]) failures += checkCase ( 110 , "\r̈ऀ" , [ "\r" , "̈ऀ" ]) failures += checkCase ( 111 , "\r्" , [ "\r" , "्" ]) failures += checkCase ( 112 , "\r्̈" , [ "\r" , "्̈" ]) failures += checkCase ( 113 , "\r" , [ "\r" , "" ]) failures += checkCase ( 114 , "\r̈" , [ "\r" , "̈" ]) failures += checkCase ( 115 , "\r" , [ "\r" , "" ]) failures += checkCase ( 116 , "\r̈" , [ "\r" , "̈" , "" ]) failures += checkCase ( 117 , "\n " , [ "\n" , " " ]) failures += checkCase ( 118 , "\n̈ " , [ "\n" , "̈" , " " ]) failures += checkCase ( 119 , "\n\r" , [ "\n" , "\r" ]) failures += checkCase ( 120 , "\n̈\r" , [ "\n" , "̈" , "\r" ]) failures += checkCase ( 121 , "\n\n" , [ "\n" , "\n" ]) failures += checkCase ( 122 , "\n̈\n" , [ "\n" , "̈" , "\n" ]) failures += checkCase ( 123 , "\n" , [ "\n" , "" ]) failures += checkCase ( 124 , "\n̈" , [ "\n" , "̈" , "" ]) failures += checkCase ( 125 , "\n" , [ "\n" , "" ]) failures += checkCase ( 126 , "\n̈" , [ "\n" , "̈" ]) failures += checkCase ( 127 , "\n🇦" , [ "\n" , "🇦" ]) failures += checkCase ( 128 , "\n̈🇦" , [ "\n" , "̈" , "🇦" ]) failures += checkCase ( 129 , "\n" , [ "\n" , "" ]) failures += checkCase ( 130 , "\n̈" , [ "\n" , "̈" , "" ]) failures += checkCase ( 131 , "\nਃ" , [ "\n" , "ਃ" ]) failures += checkCase ( 132 , "\n̈ਃ" , [ "\n" , "̈ਃ" ]) failures += checkCase ( 133 , "\nᄀ" , [ "\n" , "ᄀ" ]) failures += checkCase ( 134 , "\n̈ᄀ" , [ "\n" , "̈" , "ᄀ" ]) failures += checkCase ( 135 , "\nᅠ" , [ "\n" , "ᅠ" ]) failures += checkCase ( 136 , "\n̈ᅠ" , [ "\n" , "̈" , "ᅠ" ]) failures += checkCase ( 137 , "\nᆨ" , [ "\n" , "ᆨ" ]) failures += checkCase ( 138 , "\n̈ᆨ" , [ "\n" , "̈" , "ᆨ" ]) failures += checkCase ( 139 , "\n가" , [ "\n" , "가" ]) failures += checkCase ( 140 , "\n̈가" , [ "\n" , "̈" , "가" ]) failures += checkCase ( 141 , "\n각" , [ "\n" , "각" ]) failures += checkCase ( 142 , "\n̈각" , [ "\n" , "̈" , "각" ]) failures += checkCase ( 143 , "\nः" , [ "\n" , "ः" ]) failures += checkCase ( 144 , "\n̈ः" , [ "\n" , "̈ः" ]) failures += checkCase ( 145 , "\nऄ" , [ "\n" , "ऄ" ]) failures += checkCase ( 146 , "\n̈ऄ" , [ "\n" , "̈" , "ऄ" ]) failures += checkCase ( 147 , "\nൎ" , [ "\n" , "ൎ" ]) failures += checkCase ( 148 , "\n̈ൎ" , [ "\n" , "̈" , "ൎ" ]) failures += checkCase ( 149 , "\nक" , [ "\n" , "क" ]) failures += checkCase ( 150 , "\n̈क" , [ "\n" , "̈" , "क" ]) failures += checkCase ( 151 , "\n⌚" , [ "\n" , "⌚" ]) failures += checkCase ( 152 , "\n̈⌚" , [ "\n" , "̈" , "⌚" ]) failures } graphemecases2.tpz Check every published Unicode 16 grapheme test row import graphemesupport { checkCase } export function run () -> int { let mut failures = 0 failures += checkCase ( 153 , "\ǹ" , [ "\n" , "̀" ]) failures += checkCase ( 154 , "\n̈̀" , [ "\n" , "̈̀" ]) failures += checkCase ( 155 , "\nऀ" , [ "\n" , "ऀ" ]) failures += checkCase ( 156 , "\n̈ऀ" , [ "\n" , "̈ऀ" ]) failures += checkCase ( 157 , "\n्" , [ "\n" , "्" ]) failures += checkCase ( 158 , "\n्̈" , [ "\n" , "्̈" ]) failures += checkCase ( 159 , "\n" , [ "\n" , "" ]) failures += checkCase ( 160 , "\n̈" , [ "\n" , "̈" ]) failures += checkCase ( 161 , "\n" , [ "\n" , "" ]) failures += checkCase ( 162 , "\n̈" , [ "\n" , "̈" , "" ]) failures += checkCase ( 163 , " " , [ "" , " " ]) failures += checkCase ( 164 , "̈ " , [ "" , "̈" , " " ]) failures += checkCase ( 165 , "\r" , [ "" , "\r" ]) failures += checkCase ( 166 , "̈\r" , [ "" , "̈" , "\r" ]) failures += checkCase ( 167 , "\n" , [ "" , "\n" ]) failures += checkCase ( 168 , "̈\n" , [ "" , "̈" , "\n" ]) failures += checkCase ( 169 , "" , [ "" , "" ]) failures += checkCase ( 170 , "̈" , [ "" , "̈" , "" ]) failures += checkCase ( 171 , "" , [ "" , "" ]) failures += checkCase ( 172 , "̈" , [ "" , "̈" ]) failures += checkCase ( 173 , "🇦" , [ "" , "🇦" ]) failures += checkCase ( 174 , "̈🇦" , [ "" , "̈" , "🇦" ]) failures += checkCase ( 175 , "" , [ "" , "" ]) failures += checkCase ( 176 , "̈" , [ "" , "̈" , "" ]) failures += checkCase ( 177 , "ਃ" , [ "" , "ਃ" ]) failures += checkCase ( 178 , "̈ਃ" , [ "" , "̈ਃ" ]) failures += checkCase ( 179 , "ᄀ" , [ "" , "ᄀ" ]) failures += checkCase ( 180 , "̈ᄀ" , [ "" , "̈" , "ᄀ" ]) failures += checkCase ( 181 , "ᅠ" , [ "" , "ᅠ" ]) failures += checkCase ( 182 , "̈ᅠ" , [ "" , "̈" , "ᅠ" ]) failures += checkCase ( 183 , "ᆨ" , [ "" , "ᆨ" ]) failures += checkCase ( 184 , "̈ᆨ" , [ "" , "̈" , "ᆨ" ]) failures += checkCase ( 185 , "가" , [ "" , "가" ]) failures += checkCase ( 186 , "̈가" , [ "" , "̈" , "가" ]) failures += checkCase ( 187 , "각" , [ "" , "각" ]) failures += checkCase ( 188 , "̈각" , [ "" , "̈" , "각" ]) failures += checkCase ( 189 , "ः" , [ "" , "ः" ]) failures += checkCase ( 190 , "̈ः" , [ "" , "̈ः" ]) failures += checkCase ( 191 , "ऄ" , [ "" , "ऄ" ]) failures += checkCase ( 192 , "̈ऄ" , [ "" , "̈" , "ऄ" ]) failures += checkCase ( 193 , "ൎ" , [ "" , "ൎ" ]) failures += checkCase ( 194 , "̈ൎ" , [ "" , "̈" , "ൎ" ]) failures += checkCase ( 195 , "क" , [ "" , "क" ]) failures += checkCase ( 196 , "̈क" , [ "" , "̈" , "क" ]) failures += checkCase ( 197 , "⌚" , [ "" , "⌚" ]) failures += checkCase ( 198 , "̈⌚" , [ "" , "̈" , "⌚" ]) failures += checkCase ( 199 , "̀" , [ "" , "̀" ]) failures += checkCase ( 200 , "̈̀" , [ "" , "̈̀" ]) failures += checkCase ( 201 , "ऀ" , [ "" , "ऀ" ]) failures += checkCase ( 202 , "̈ऀ" , [ "" , "̈ऀ" ]) failures += checkCase ( 203 , "्" , [ "" , "्" ]) failures += checkCase ( 204 , "्̈" , [ "" , "्̈" ]) failures += checkCase ( 205 , "" , [ "" , "" ]) failures += checkCase ( 206 , "̈" , [ "" , "̈" ]) failures += checkCase ( 207 , "" , [ "" , "" ]) failures += checkCase ( 208 , "̈" , [ "" , "̈" , "" ]) failures += checkCase ( 209 , " " , [ "" , " " ]) failures += checkCase ( 210 , "̈ " , [ "̈" , " " ]) failures += checkCase ( 211 , "\r" , [ "" , "\r" ]) failures += checkCase ( 212 , "̈\r" , [ "̈" , "\r" ]) failures += checkCase ( 213 , "\n" , [ "" , "\n" ]) failures += checkCase ( 214 , "̈\n" , [ "̈" , "\n" ]) failures += checkCase ( 215 , "" , [ "" , "" ]) failures += checkCase ( 216 , "̈" , [ "̈" , "" ]) failures } graphemecases3.tpz Check every published Unicode 16 grapheme test row import graphemesupport { checkCase } export function run () -> int { let mut failures = 0 failures += checkCase ( 217 , "" , [ "" ]) failures += checkCase ( 218 , "̈" , [ "̈" ]) failures += checkCase ( 219 , "🇦" , [ "" , "🇦" ]) failures += checkCase ( 220 , "̈🇦" , [ "̈" , "🇦" ]) failures += checkCase ( 221 , "" , [ "" , "" ]) failures += checkCase ( 222 , "̈" , [ "̈" , "" ]) failures += checkCase ( 223 , "ਃ" , [ "ਃ" ]) failures += checkCase ( 224 , "̈ਃ" , [ "̈ਃ" ]) failures += checkCase ( 225 , "ᄀ" , [ "" , "ᄀ" ]) failures += checkCase ( 226 , "̈ᄀ" , [ "̈" , "ᄀ" ]) failures += checkCase ( 227 , "ᅠ" , [ "" , "ᅠ" ]) failures += checkCase ( 228 , "̈ᅠ" , [ "̈" , "ᅠ" ]) failures += checkCase ( 229 , "ᆨ" , [ "" , "ᆨ" ]) failures += checkCase ( 230 , "̈ᆨ" , [ "̈" , "ᆨ" ]) failures += checkCase ( 231 , "가" , [ "" , "가" ]) failures += checkCase ( 232 , "̈가" , [ "̈" , "가" ]) failures += checkCase ( 233 , "각" , [ "" , "각" ]) failures += checkCase ( 234 , "̈각" , [ "̈" , "각" ]) failures += checkCase ( 235 , "ः" , [ "ः" ]) failures += checkCase ( 236 , "̈ः" , [ "̈ः" ]) failures += checkCase ( 237 , "ऄ" , [ "" , "ऄ" ]) failures += checkCase ( 238 , "̈ऄ" , [ "̈" , "ऄ" ]) failures += checkCase ( 239 , "ൎ" , [ "" , "ൎ" ]) failures += checkCase ( 240 , "̈ൎ" , [ "̈" , "ൎ" ]) failures += checkCase ( 241 , "क" , [ "" , "क" ]) failures += checkCase ( 242 , "̈क" , [ "̈" , "क" ]) failures += checkCase ( 243 , "⌚" , [ "" , "⌚" ]) failures += checkCase ( 244 , "̈⌚" , [ "̈" , "⌚" ]) failures += checkCase ( 245 , "̀" , [ "̀" ]) failures += checkCase ( 246 , "̈̀" , [ "̈̀" ]) failures += checkCase ( 247 , "ऀ" , [ "ऀ" ]) failures += checkCase ( 248 , "̈ऀ" , [ "̈ऀ" ]) failures += checkCase ( 249 , "्" , [ "्" ]) failures += checkCase ( 250 , "्̈" , [ "्̈" ]) failures += checkCase ( 251 , "" , [ "" ]) failures += checkCase ( 252 , "̈" , [ "̈" ]) failures += checkCase ( 253 , "" , [ "" , "" ]) failures += checkCase ( 254 , "̈" , [ "̈" , "" ]) failures += checkCase ( 255 , "🇦 " , [ "🇦" , " " ]) failures += checkCase ( 256 , "🇦̈ " , [ "🇦̈" , " " ]) failures += checkCase ( 257 , "🇦\r" , [ "🇦" , "\r" ]) failures += checkCase ( 258 , "🇦̈\r" , [ "🇦̈" , "\r" ]) failures += checkCase ( 259 , "🇦\n" , [ "🇦" , "\n" ]) failures += checkCase ( 260 , "🇦̈\n" , [ "🇦̈" , "\n" ]) failures += checkCase ( 261 , "🇦" , [ "🇦" , "" ]) failures += checkCase ( 262 , "🇦̈" , [ "🇦̈" , "" ]) failures += checkCase ( 263 , "🇦" , [ "🇦" ]) failures += checkCase ( 264 , "🇦̈" , [ "🇦̈" ]) failures += checkCase ( 265 , "🇦🇦" , [ "🇦🇦" ]) failures += checkCase ( 266 , "🇦̈🇦" , [ "🇦̈" , "🇦" ]) failures += checkCase ( 267 , "🇦" , [ "🇦" , "" ]) failures += checkCase ( 268 , "🇦̈" , [ "🇦̈" , "" ]) failures += checkCase ( 269 , "🇦ਃ" , [ "🇦ਃ" ]) failures += checkCase ( 270 , "🇦̈ਃ" , [ "🇦̈ਃ" ]) failures += checkCase ( 271 , "🇦ᄀ" , [ "🇦" , "ᄀ" ]) failures += checkCase ( 272 , "🇦̈ᄀ" , [ "🇦̈" , "ᄀ" ]) failures += checkCase ( 273 , "🇦ᅠ" , [ "🇦" , "ᅠ" ]) failures += checkCase ( 274 , "🇦̈ᅠ" , [ "🇦̈" , "ᅠ" ]) failures += checkCase ( 275 , "🇦ᆨ" , [ "🇦" , "ᆨ" ]) failures += checkCase ( 276 , "🇦̈ᆨ" , [ "🇦̈" , "ᆨ" ]) failures += checkCase ( 277 , "🇦가" , [ "🇦" , "가" ]) failures += checkCase ( 278 , "🇦̈가" , [ "🇦̈" , "가" ]) failures += checkCase ( 279 , "🇦각" , [ "🇦" , "각" ]) failures += checkCase ( 280 , "🇦̈각" , [ "🇦̈" , "각" ]) failures } graphemecases4.tpz Check every published Unicode 16 grapheme test row import graphemesupport { checkCase } export function run () -> int { let mut failures = 0 failures += checkCase ( 281 , "🇦ः" , [ "🇦ः" ]) failures += checkCase ( 282 , "🇦̈ः" , [ "🇦̈ः" ]) failures += checkCase ( 283 , "🇦ऄ" , [ "🇦" , "ऄ" ]) failures += checkCase ( 284 , "🇦̈ऄ" , [ "🇦̈" , "ऄ" ]) failures += checkCase ( 285 , "🇦ൎ" , [ "🇦" , "ൎ" ]) failures += checkCase ( 286 , "🇦̈ൎ" , [ "🇦̈" , "ൎ" ]) failures += checkCase ( 287 , "🇦क" , [ "🇦" , "क" ]) failures += checkCase ( 288 , "🇦̈क" , [ "🇦̈" , "क" ]) failures += checkCase ( 289 , "🇦⌚" , [ "🇦" , "⌚" ]) failures += checkCase ( 290 , "🇦̈⌚" , [ "🇦̈" , "⌚" ]) failures += checkCase ( 291 , "🇦̀" , [ "🇦̀" ]) failures += checkCase ( 292 , "🇦̈̀" , [ "🇦̈̀" ]) failures += checkCase ( 293 , "🇦ऀ" , [ "🇦ऀ" ]) failures += checkCase ( 294 , "🇦̈ऀ" , [ "🇦̈ऀ" ]) failures += checkCase ( 295 , "🇦्" , [ "🇦्" ]) failures += checkCase ( 296 , "🇦्̈" , [ "🇦्̈" ]) failures += checkCase ( 297 , "🇦" , [ "🇦" ]) failures += checkCase ( 298 , "🇦̈" , [ "🇦̈" ]) failures += checkCase ( 299 , "🇦" , [ "🇦" , "" ]) failures += checkCase ( 300 , "🇦̈" , [ "🇦̈" , "" ]) failures += checkCase ( 301 , " " , [ " " ]) failures += checkCase ( 302 , "̈ " , [ "̈" , " " ]) failures += checkCase ( 303 , "\r" , [ "" , "\r" ]) failures += checkCase ( 304 , "̈\r" , [ "̈" , "\r" ]) failures += checkCase ( 305 , "\n" , [ "" , "\n" ]) failures += checkCase ( 306 , "̈\n" , [ "̈" , "\n" ]) failures += checkCase ( 307 , "" , [ "" , "" ]) failures += checkCase ( 308 , "̈" , [ "̈" , "" ]) failures += checkCase ( 309 , "" , [ "" ]) failures += checkCase ( 310 , "̈" , [ "̈" ]) failures += checkCase ( 311 , "🇦" , [ "🇦" ]) failures += checkCase ( 312 , "̈🇦" , [ "̈" , "🇦" ]) failures += checkCase ( 313 , "" , [ "" ]) failures += checkCase ( 314 , "̈" , [ "̈" , "" ]) failures += checkCase ( 315 , "ਃ" , [ "ਃ" ]) failures += checkCase ( 316 , "̈ਃ" , [ "̈ਃ" ]) failures += checkCase ( 317 , "ᄀ" , [ "ᄀ" ]) failures += checkCase ( 318 , "̈ᄀ" , [ "̈" , "ᄀ" ]) failures += checkCase ( 319 , "ᅠ" , [ "ᅠ" ]) failures += checkCase ( 320 , "̈ᅠ" , [ "̈" , "ᅠ" ]) failures += checkCase ( 321 , "ᆨ" , [ "ᆨ" ]) failures += checkCase ( 322 , "̈ᆨ" , [ "̈" , "ᆨ" ]) failures += checkCase ( 323 , "가" , [ "가" ]) failures += checkCase ( 324 , "̈가" , [ "̈" , "가" ]) failures += checkCase ( 325 , "각" , [ "각" ]) failures += checkCase ( 326 , "̈각" , [ "̈" , "각" ]) failures += checkCase ( 327 , "ः" , [ "ः" ]) failures += checkCase ( 328 , "̈ः" , [ "̈ः" ]) failures += checkCase ( 329 , "ऄ" , [ "ऄ" ]) failures += checkCase ( 330 , "̈ऄ" , [ "̈" , "ऄ" ]) failures += checkCase ( 331 , "ൎ" , [ "ൎ" ]) failures += checkCase ( 332 , "̈ൎ" , [ "̈" , "ൎ" ]) failures += checkCase ( 333 , "क" , [ "क" ]) failures += checkCase ( 334 , "̈क" , [ "̈" , "क" ]) failures += checkCase ( 335 , "⌚" , [ "⌚" ]) failures += checkCase ( 336 , "̈⌚" , [ "̈" , "⌚" ]) failures += checkCase ( 337 , "̀" , [ "̀" ]) failures += checkCase ( 338 , "̈̀" , [ "̈̀" ]) failures += checkCase ( 339 , "ऀ" , [ "ऀ" ]) failures += checkCase ( 340 , "̈ऀ" , [ "̈ऀ" ]) failures += checkCase ( 341 , "्" , [ "्" ]) failures += checkCase ( 342 , "्̈" , [ "्̈" ]) failures += checkCase ( 343 , "" , [ "" ]) failures += checkCase ( 344 , "̈" , [ "̈" ]) failures } graphemecases5.tpz Check every published Unicode 16 grapheme test row import graphemesupport { checkCase } export function run () -> int { let mut failures = 0 failures += checkCase ( 345 , "" , [ "" ]) failures += checkCase ( 346 , "̈" , [ "̈" , "" ]) failures += checkCase ( 347 , "ਃ " , [ "ਃ" , " " ]) failures += checkCase ( 348 , "ਃ̈ " , [ "ਃ̈" , " " ]) failures += checkCase ( 349 , "ਃ\r" , [ "ਃ" , "\r" ]) failures += checkCase ( 350 , "ਃ̈\r" , [ "ਃ̈" , "\r" ]) failures += checkCase ( 351 , "ਃ\n" , [ "ਃ" , "\n" ]) failures += checkCase ( 352 , "ਃ̈\n" , [ "ਃ̈" , "\n" ]) failures += checkCase ( 353 , "ਃ" , [ "ਃ" , "" ]) failures += checkCase ( 354 , "ਃ̈" , [ "ਃ̈" , "" ]) failures += checkCase ( 355 , "ਃ" , [ "ਃ" ]) failures += checkCase ( 356 , "ਃ̈" , [ "ਃ̈" ]) failures += checkCase ( 357 , "ਃ🇦" , [ "ਃ" , "🇦" ]) failures += checkCase ( 358 , "ਃ̈🇦" , [ "ਃ̈" , "🇦" ]) failures += checkCase ( 359 , "ਃ" , [ "ਃ" , "" ]) failures += checkCase ( 360 , "ਃ̈" , [ "ਃ̈" , "" ]) failures += checkCase ( 361 , "ਃਃ" , [ "ਃਃ" ]) failures += checkCase ( 362 , "ਃ̈ਃ" , [ "ਃ̈ਃ" ]) failures += checkCase ( 363 , "ਃᄀ" , [ "ਃ" , "ᄀ" ]) failures += checkCase ( 364 , "ਃ̈ᄀ" , [ "ਃ̈" , "ᄀ" ]) failures += checkCase ( 365 , "ਃᅠ" , [ "ਃ" , "ᅠ" ]) failures += checkCase ( 366 , "ਃ̈ᅠ" , [ "ਃ̈" , "ᅠ" ]) failures += checkCase ( 367 , "ਃᆨ" , [ "ਃ" , "ᆨ" ]) failures += checkCase ( 368 , "ਃ̈ᆨ" , [ "ਃ̈" , "ᆨ" ]) failures += checkCase ( 369 , "ਃ가" , [ "ਃ" , "가" ]) failures += checkCase ( 370 , "ਃ̈가" , [ "ਃ̈" , "가" ]) failures += checkCase ( 371 , "ਃ각" , [ "ਃ" , "각" ]) failures += checkCase ( 372 , "ਃ̈각" , [ "ਃ̈" , "각" ]) failures += checkCase ( 373 , "ਃः" , [ "ਃः" ]) failures += checkCase ( 374 , "ਃ̈ः" , [ "ਃ̈ः" ]) failures += checkCase ( 375 , "ਃऄ" , [ "ਃ" , "ऄ" ]) failures += checkCase ( 376 , "ਃ̈ऄ" , [ "ਃ̈" , "ऄ" ]) failures += checkCase ( 377 , "ਃൎ" , [ "ਃ" , "ൎ" ]) failures += checkCase ( 378 , "ਃ̈ൎ" , [ "ਃ̈" , "ൎ" ]) failures += checkCase ( 379 , "ਃक" , [ "ਃ" , "क" ]) failures += checkCase ( 380 , "ਃ̈क" , [ "ਃ̈" , "क" ]) failures += checkCase ( 381 , "ਃ⌚" , [ "ਃ" , "⌚" ]) failures += checkCase ( 382 , "ਃ̈⌚" , [ "ਃ̈" , "⌚" ]) failures += checkCase ( 383 , "ਃ̀" , [ "ਃ̀" ]) failures += checkCase ( 384 , "ਃ̈̀" , [ "ਃ̈̀" ]) failures += checkCase ( 385 , "ਃऀ" , [ "ਃऀ" ]) failures += checkCase ( 386 , "ਃ̈ऀ" , [ "ਃ̈ऀ" ]) failures += checkCase ( 387 , "ਃ्" , [ "ਃ्" ]) failures += checkCase ( 388 , "ਃ्̈" , [ "ਃ्̈" ]) failures += checkCase ( 389 , "ਃ" , [ "ਃ" ]) failures += checkCase ( 390 , "ਃ̈" , [ "ਃ̈" ]) failures += checkCase ( 391 , "ਃ" , [ "ਃ" , "" ]) failures += checkCase ( 392 , "ਃ̈" , [ "ਃ̈" , "" ]) failures += checkCase ( 393 , "ᄀ " , [ "ᄀ" , " " ]) failures += checkCase ( 394 , "ᄀ̈ " , [ "ᄀ̈" , " " ]) failures += checkCase ( 395 , "ᄀ\r" , [ "ᄀ" , "\r" ]) failures += checkCase ( 396 , "ᄀ̈\r" , [ "ᄀ̈" , "\r" ]) failures += checkCase ( 397 , "ᄀ\n" , [ "ᄀ" , "\n" ]) failures += checkCase ( 398 , "ᄀ̈\n" , [ "ᄀ̈" , "\n" ]) failures += checkCase ( 399 , "ᄀ" , [ "ᄀ" , "" ]) failures += checkCase ( 400 , "ᄀ̈" , [ "ᄀ̈" , "" ]) failures += checkCase ( 401 , "ᄀ" , [ "ᄀ" ]) failures += checkCase ( 402 , "ᄀ̈" , [ "ᄀ̈" ]) failures += checkCase ( 403 , "ᄀ🇦" , [ "ᄀ" , "🇦" ]) failures += checkCase ( 404 , "ᄀ̈🇦" , [ "ᄀ̈" , "🇦" ]) failures += checkCase ( 405 , "ᄀ" , [ "ᄀ" , "" ]) failures += checkCase ( 406 , "ᄀ̈" , [ "ᄀ̈" , "" ]) failures += checkCase ( 407 , "ᄀਃ" , [ "ᄀਃ" ]) failures += checkCase ( 408 , "ᄀ̈ਃ" , [ "ᄀ̈ਃ" ]) failures } graphemecases6.tpz Check every published Unicode 16 grapheme test row import graphemesupport { checkCase } export function run () -> int { let mut failures = 0 failures += checkCase ( 409 , "ᄀᄀ" , [ "ᄀᄀ" ]) failures += checkCase ( 410 , "ᄀ̈ᄀ" , [ "ᄀ̈" , "ᄀ" ]) failures += checkCase ( 411 , "ᄀᅠ" , [ "ᄀᅠ" ]) failures += checkCase ( 412 , "ᄀ̈ᅠ" , [ "ᄀ̈" , "ᅠ" ]) failures += checkCase ( 413 , "ᄀᆨ" , [ "ᄀ" , "ᆨ" ]) failures += checkCase ( 414 , "ᄀ̈ᆨ" , [ "ᄀ̈" , "ᆨ" ]) failures += checkCase ( 415 , "ᄀ가" , [ "ᄀ가" ]) failures += checkCase ( 416 , "ᄀ̈가" , [ "ᄀ̈" , "가" ]) failures += checkCase ( 417 , "ᄀ각" , [ "ᄀ각" ]) failures += checkCase ( 418 , "ᄀ̈각" , [ "ᄀ̈" , "각" ]) failures += checkCase ( 419 , "ᄀः" , [ "ᄀः" ]) failures += checkCase ( 420 , "ᄀ̈ः" , [ "ᄀ̈ः" ]) failures += checkCase ( 421 , "ᄀऄ" , [ "ᄀ" , "ऄ" ]) failures += checkCase ( 422 , "ᄀ̈ऄ" , [ "ᄀ̈" , "ऄ" ]) failures += checkCase ( 423 , "ᄀൎ" , [ "ᄀ" , "ൎ" ]) failures += checkCase ( 424 , "ᄀ̈ൎ" , [ "ᄀ̈" , "ൎ" ]) failures += checkCase ( 425 , "ᄀक" , [ "ᄀ" , "क" ]) failures += checkCase ( 426 , "ᄀ̈क" , [ "ᄀ̈" , "क" ]) failures += checkCase ( 427 , "ᄀ⌚" , [ "ᄀ" , "⌚" ]) failures += checkCase ( 428 , "ᄀ̈⌚" , [ "ᄀ̈" , "⌚" ]) failures += checkCase ( 429 , "ᄀ̀" , [ "ᄀ̀" ]) failures += checkCase ( 430 , "ᄀ̈̀" , [ "ᄀ̈̀" ]) failures += checkCase ( 431 , "ᄀऀ" , [ "ᄀऀ" ]) failures += checkCase ( 432 , "ᄀ̈ऀ" , [ "ᄀ̈ऀ" ]) failures += checkCase ( 433 , "ᄀ्" , [ "ᄀ्" ]) failures += checkCase ( 434 , "ᄀ्̈" , [ "ᄀ्̈" ]) failures += checkCase ( 435 , "ᄀ" , [ "ᄀ" ]) failures += checkCase ( 436 , "ᄀ̈" , [ "ᄀ̈" ]) failures += checkCase ( 437 , "ᄀ" , [ "ᄀ" , "" ]) failures += checkCase ( 438 , "ᄀ̈" , [ "ᄀ̈" , "" ]) failures += checkCase ( 439 , "ᅠ " , [ "ᅠ" , " " ]) failures += checkCase ( 440 , "ᅠ̈ " , [ "ᅠ̈" , " " ]) failures += checkCase ( 441 , "ᅠ\r" , [ "ᅠ" , "\r" ]) failures += checkCase ( 442 , "ᅠ̈\r" , [ "ᅠ̈" , "\r" ]) failures += checkCase ( 443 , "ᅠ\n" , [ "ᅠ" , "\n" ]) failures += checkCase ( 444 , "ᅠ̈\n" , [ "ᅠ̈" , "\n" ]) failures += checkCase ( 445 , "ᅠ" , [ "ᅠ" , "" ]) failures += checkCase ( 446 , "ᅠ̈" , [ "ᅠ̈" , "" ]) failures += checkCase ( 447 , "ᅠ" , [ "ᅠ" ]) failures += checkCase ( 448 , "ᅠ̈" , [ "ᅠ̈" ]) failures += checkCase ( 449 , "ᅠ🇦" , [ "ᅠ" , "🇦" ]) failures += checkCase ( 450 , "ᅠ̈🇦" , [ "ᅠ̈" , "🇦" ]) failures += checkCase ( 451 , "ᅠ" , [ "ᅠ" , "" ]) failures += checkCase ( 452 , "ᅠ̈" , [ "ᅠ̈" , "" ]) failures += checkCase ( 453 , "ᅠਃ" , [ "ᅠਃ" ]) failures += checkCase ( 454 , "ᅠ̈ਃ" , [ "ᅠ̈ਃ" ]) failures += checkCase ( 455 , "ᅠᄀ" , [ "ᅠ" , "ᄀ" ]) failures += checkCase ( 456 , "ᅠ̈ᄀ" , [ "ᅠ̈" , "ᄀ" ]) failures += checkCase ( 457 , "ᅠᅠ" , [ "ᅠᅠ" ]) failures += checkCase ( 458 , "ᅠ̈ᅠ" , [ "ᅠ̈" , "ᅠ" ]) failures += checkCase ( 459 , "ᅠᆨ" , [ "ᅠᆨ" ]) failures += checkCase ( 460 , "ᅠ̈ᆨ" , [ "ᅠ̈" , "ᆨ" ]) failures += checkCase ( 461 , "ᅠ가" , [ "ᅠ" , "가" ]) failures += checkCase ( 462 , "ᅠ̈가" , [ "ᅠ̈" , "가" ]) failures += checkCase ( 463 , "ᅠ각" , [ "ᅠ" , "각" ]) failures += checkCase ( 464 , "ᅠ̈각" , [ "ᅠ̈" , "각" ]) failures += checkCase ( 465 , "ᅠः" , [ "ᅠः" ]) failures += checkCase ( 466 , "ᅠ̈ः" , [ "ᅠ̈ः" ]) failures += checkCase ( 467 , "ᅠऄ" , [ "ᅠ" , "ऄ" ]) failures += checkCase ( 468 , "ᅠ̈ऄ" , [ "ᅠ̈" , "ऄ" ]) failures += checkCase ( 469 , "ᅠൎ" , [ "ᅠ" , "ൎ" ]) failures += checkCase ( 470 , "ᅠ̈ൎ" , [ "ᅠ̈" , "ൎ" ]) failures += checkCase ( 471 , "ᅠक" , [ "ᅠ" , "क" ]) failures += checkCase ( 472 , "ᅠ̈क" , [ "ᅠ̈" , "क" ]) failures } graphemecases7.tpz Check every published Unicode 16 grapheme test row import graphemesupport { checkCase } export function run () -> int { let mut failures = 0 failures += checkCase ( 473 , "ᅠ⌚" , [ "ᅠ" , "⌚" ]) failures += checkCase ( 474 , "ᅠ̈⌚" , [ "ᅠ̈" , "⌚" ]) failures += checkCase ( 475 , "ᅠ̀" , [ "ᅠ̀" ]) failures += checkCase ( 476 , "ᅠ̈̀" , [ "ᅠ̈̀" ]) failures += checkCase ( 477 , "ᅠऀ" , [ "ᅠऀ" ]) failures += checkCase ( 478 , "ᅠ̈ऀ" , [ "ᅠ̈ऀ" ]) failures += checkCase ( 479 , "ᅠ्" , [ "ᅠ्" ]) failures += checkCase ( 480 , "ᅠ्̈" , [ "ᅠ्̈" ]) failures += checkCase ( 481 , "ᅠ" , [ "ᅠ" ]) failures += checkCase ( 482 , "ᅠ̈" , [ "ᅠ̈" ]) failures += checkCase ( 483 , "ᅠ" , [ "ᅠ" , "" ]) failures += checkCase ( 484 , "ᅠ̈" , [ "ᅠ̈" , "" ]) failures += checkCase ( 485 , "ᆨ " , [ "ᆨ" , " " ]) failures += checkCase ( 486 , "ᆨ̈ " , [ "ᆨ̈" , " " ]) failures += checkCase ( 487 , "ᆨ\r" , [ "ᆨ" , "\r" ]) failures += checkCase ( 488 , "ᆨ̈\r" , [ "ᆨ̈" , "\r" ]) failures += checkCase ( 489 , "ᆨ\n" , [ "ᆨ" , "\n" ]) failures += checkCase ( 490 , "ᆨ̈\n" , [ "ᆨ̈" , "\n" ]) failures += checkCase ( 491 , "ᆨ" , [ "ᆨ" , "" ]) failures += checkCase ( 492 , "ᆨ̈" , [ "ᆨ̈" , "" ]) failures += checkCase ( 493 , "ᆨ" , [ "ᆨ" ]) failures += checkCase ( 494 , "ᆨ̈" , [ "ᆨ̈" ]) failures += checkCase ( 495 , "ᆨ🇦" , [ "ᆨ" , "🇦" ]) failures += checkCase ( 496 , "ᆨ̈🇦" , [ "ᆨ̈" , "🇦" ]) failures += checkCase ( 497 , "ᆨ" , [ "ᆨ" , "" ]) failures += checkCase ( 498 , "ᆨ̈" , [ "ᆨ̈" , "" ]) failures += checkCase ( 499 , "ᆨਃ" , [ "ᆨਃ" ]) failures += checkCase ( 500 , "ᆨ̈ਃ" , [ "ᆨ̈ਃ" ]) failures += checkCase ( 501 , "ᆨᄀ" , [ "ᆨ" , "ᄀ" ]) failures += checkCase ( 502 , "ᆨ̈ᄀ" , [ "ᆨ̈" , "ᄀ" ]) failures += checkCase ( 503 , "ᆨᅠ" , [ "ᆨ" , "ᅠ" ]) failures += checkCase ( 504 , "ᆨ̈ᅠ" , [ "ᆨ̈" , "ᅠ" ]) failures += checkCase ( 505 , "ᆨᆨ" , [ "ᆨᆨ" ]) failures += checkCase ( 506 , "ᆨ̈ᆨ" , [ "ᆨ̈" , "ᆨ" ]) failures += checkCase ( 507 , "ᆨ가" , [ "ᆨ" , "가" ]) failures += checkCase ( 508 , "ᆨ̈가" , [ "ᆨ̈" , "가" ]) failures += checkCase ( 509 , "ᆨ각" , [ "ᆨ" , "각" ]) failures += checkCase ( 510 , "ᆨ̈각" , [ "ᆨ̈" , "각" ]) failures += checkCase ( 511 , "ᆨः" , [ "ᆨः" ]) failures += checkCase ( 512 , "ᆨ̈ः" , [ "ᆨ̈ः" ]) failures += checkCase ( 513 , "ᆨऄ" , [ "ᆨ" , "ऄ" ]) failures += checkCase ( 514 , "ᆨ̈ऄ" , [ "ᆨ̈" , "ऄ" ]) failures += checkCase ( 515 , "ᆨൎ" , [ "ᆨ" , "ൎ" ]) failures += checkCase ( 516 , "ᆨ̈ൎ" , [ "ᆨ̈" , "ൎ" ]) failures += checkCase ( 517 , "ᆨक" , [ "ᆨ" , "क" ]) failures += checkCase ( 518 , "ᆨ̈क" , [ "ᆨ̈" , "क" ]) failures += checkCase ( 519 , "ᆨ⌚" , [ "ᆨ" , "⌚" ]) failures += checkCase ( 520 , "ᆨ̈⌚" , [ "ᆨ̈" , "⌚" ]) failures += checkCase ( 521 , "ᆨ̀" , [ "ᆨ̀" ]) failures += checkCase ( 522 , "ᆨ̈̀" , [ "ᆨ̈̀" ]) failures += checkCase ( 523 , "ᆨऀ" , [ "ᆨऀ" ]) failures += checkCase ( 524 , "ᆨ̈ऀ" , [ "ᆨ̈ऀ" ]) failures += checkCase ( 525 , "ᆨ्" , [ "ᆨ्" ]) failures += checkCase ( 526 , "ᆨ्̈" , [ "ᆨ्̈" ]) failures += checkCase ( 527 , "ᆨ" , [ "ᆨ" ]) failures += checkCase ( 528 , "ᆨ̈" , [ "ᆨ̈" ]) failures += checkCase ( 529 , "ᆨ" , [ "ᆨ" , "" ]) failures += checkCase ( 530 , "ᆨ̈" , [ "ᆨ̈" , "" ]) failures += checkCase ( 531 , "가 " , [ "가" , " " ]) failures += checkCase ( 532 , "가̈ " , [ "가̈" , " " ]) failures += checkCase ( 533 , "가\r" , [ "가" , "\r" ]) failures += checkCase ( 534 , "가̈\r" , [ "가̈" , "\r" ]) failures += checkCase ( 535 , "가\n" , [ "가" , "\n" ]) failures += checkCase ( 536 , "가̈\n" , [ "가̈" , "\n" ]) failures } graphemecases8.tpz Check every published Unicode 16 grapheme test row import graphemesupport { checkCase } export function run () -> int { let mut failures = 0 failures += checkCase ( 537 , "가" , [ "가" , "" ]) failures += checkCase ( 538 , "가̈" , [ "가̈" , "" ]) failures += checkCase ( 539 , "가" , [ "가" ]) failures += checkCase ( 540 , "가̈" , [ "가̈" ]) failures += checkCase ( 541 , "가🇦" , [ "가" , "🇦" ]) failures += checkCase ( 542 , "가̈🇦" , [ "가̈" , "🇦" ]) failures += checkCase ( 543 , "가" , [ "가" , "" ]) failures += checkCase ( 544 , "가̈" , [ "가̈" , "" ]) failures += checkCase ( 545 , "가ਃ" , [ "가ਃ" ]) failures += checkCase ( 546 , "가̈ਃ" , [ "가̈ਃ" ]) failures += checkCase ( 547 , "가ᄀ" , [ "가" , "ᄀ" ]) failures += checkCase ( 548 , "가̈ᄀ" , [ "가̈" , "ᄀ" ]) failures += checkCase ( 549 , "가ᅠ" , [ "가ᅠ" ]) failures += checkCase ( 550 , "가̈ᅠ" , [ "가̈" , "ᅠ" ]) failures += checkCase ( 551 , "각" , [ "각" ]) failures += checkCase ( 552 , "가̈ᆨ" , [ "가̈" , "ᆨ" ]) failures += checkCase ( 553 , "가가" , [ "가" , "가" ]) failures += checkCase ( 554 , "가̈가" , [ "가̈" , "가" ]) failures += checkCase ( 555 , "가각" , [ "가" , "각" ]) failures += checkCase ( 556 , "가̈각" , [ "가̈" , "각" ]) failures += checkCase ( 557 , "가ः" , [ "가ः" ]) failures += checkCase ( 558 , "가̈ः" , [ "가̈ः" ]) failures += checkCase ( 559 , "가ऄ" , [ "가" , "ऄ" ]) failures += checkCase ( 560 , "가̈ऄ" , [ "가̈" , "ऄ" ]) failures += checkCase ( 561 , "가ൎ" , [ "가" , "ൎ" ]) failures += checkCase ( 562 , "가̈ൎ" , [ "가̈" , "ൎ" ]) failures += checkCase ( 563 , "가क" , [ "가" , "क" ]) failures += checkCase ( 564 , "가̈क" , [ "가̈" , "क" ]) failures += checkCase ( 565 , "가⌚" , [ "가" , "⌚" ]) failures += checkCase ( 566 , "가̈⌚" , [ "가̈" , "⌚" ]) failures += checkCase ( 567 , "가̀" , [ "가̀" ]) failures += checkCase ( 568 , "가̈̀" , [ "가̈̀" ]) failures += checkCase ( 569 , "가ऀ" , [ "가ऀ" ]) failures += checkCase ( 570 , "가̈ऀ" , [ "가̈ऀ" ]) failures += checkCase ( 571 , "가्" , [ "가्" ]) failures += checkCase ( 572 , "가्̈" , [ "가्̈" ]) failures += checkCase ( 573 , "가" , [ "가" ]) failures += checkCase ( 574 , "가̈" , [ "가̈" ]) failures += checkCase ( 575 , "가" , [ "가" , "" ]) failures += checkCase ( 576 , "가̈" , [ "가̈" , "" ]) failures += checkCase ( 577 , "각 " , [ "각" , " " ]) failures += checkCase ( 578 , "각̈ " , [ "각̈" , " " ]) failures += checkCase ( 579 , "각\r" , [ "각" , "\r" ]) failures += checkCase ( 580 , "각̈\r" , [ "각̈" , "\r" ]) failures += checkCase ( 581 , "각\n" , [ "각" , "\n" ]) failures += checkCase ( 582 , "각̈\n" , [ "각̈" , "\n" ]) failures += checkCase ( 583 , "각" , [ "각" , "" ]) failures += checkCase ( 584 , "각̈" , [ "각̈" , "" ]) failures += checkCase ( 585 , "각" , [ "각" ]) failures += checkCase ( 586 , "각̈" , [ "각̈" ]) failures += checkCase ( 587 , "각🇦" , [ "각" , "🇦" ]) failures += checkCase ( 588 , "각̈🇦" , [ "각̈" , "🇦" ]) failures += checkCase ( 589 , "각" , [ "각" , "" ]) failures += checkCase ( 590 , "각̈" , [ "각̈" , "" ]) failures += checkCase ( 591 , "각ਃ" , [ "각ਃ" ]) failures += checkCase ( 592 , "각̈ਃ" , [ "각̈ਃ" ]) failures += checkCase ( 593 , "각ᄀ" , [ "각" , "ᄀ" ]) failures += checkCase ( 594 , "각̈ᄀ" , [ "각̈" , "ᄀ" ]) failures += checkCase ( 595 , "각ᅠ" , [ "각" , "ᅠ" ]) failures += checkCase ( 596 , "각̈ᅠ" , [ "각̈" , "ᅠ" ]) failures += checkCase ( 597 , "각ᆨ" , [ "각ᆨ" ]) failures += checkCase ( 598 , "각̈ᆨ" , [ "각̈" , "ᆨ" ]) failures += checkCase ( 599 , "각가" , [ "각" , "가" ]) failures += checkCase ( 600 , "각̈가" , [ "각̈" , "가" ]) failures } graphemecases9.tpz Check every published Unicode 16 grapheme test row import graphemesupport { checkCase } export function run () -> int { let mut failures = 0 failures += checkCase ( 601 , "각각" , [ "각" , "각" ]) failures += checkCase ( 602 , "각̈각" , [ "각̈" , "각" ]) failures += checkCase ( 603 , "각ः" , [ "각ः" ]) failures += checkCase ( 604 , "각̈ः" , [ "각̈ः" ]) failures += checkCase ( 605 , "각ऄ" , [ "각" , "ऄ" ]) failures += checkCase ( 606 , "각̈ऄ" , [ "각̈" , "ऄ" ]) failures += checkCase ( 607 , "각ൎ" , [ "각" , "ൎ" ]) failures += checkCase ( 608 , "각̈ൎ" , [ "각̈" , "ൎ" ]) failures += checkCase ( 609 , "각क" , [ "각" , "क" ]) failures += checkCase ( 610 , "각̈क" , [ "각̈" , "क" ]) failures += checkCase ( 611 , "각⌚" , [ "각" , "⌚" ]) failures += checkCase ( 612 , "각̈⌚" , [ "각̈" , "⌚" ]) failures += checkCase ( 613 , "각̀" , [ "각̀" ]) failures += checkCase ( 614 , "각̈̀" , [ "각̈̀" ]) failures += checkCase ( 615 , "각ऀ" , [ "각ऀ" ]) failures += checkCase ( 616 , "각̈ऀ" , [ "각̈ऀ" ]) failures += checkCase ( 617 , "각्" , [ "각्" ]) failures += checkCase ( 618 , "각्̈" , [ "각्̈" ]) failures += checkCase ( 619 , "각" , [ "각" ]) failures += checkCase ( 620 , "각̈" , [ "각̈" ]) failures += checkCase ( 621 , "각" , [ "각" , "" ]) failures += checkCase ( 622 , "각̈" , [ "각̈" , "" ]) failures += checkCase ( 623 , "ः " , [ "ः" , " " ]) failures += checkCase ( 624 , "ः̈ " , [ "ः̈" , " " ]) failures += checkCase ( 625 , "ः\r" , [ "ः" , "\r" ]) failures += checkCase ( 626 , "ः̈\r" , [ "ः̈" , "\r" ]) failures += checkCase ( 627 , "ः\n" , [ "ः" , "\n" ]) failures += checkCase ( 628 , "ः̈\n" , [ "ः̈" , "\n" ]) failures += checkCase ( 629 , "ः" , [ "ः" , "" ]) failures += checkCase ( 630 , "ः̈" , [ "ः̈" , "" ]) failures += checkCase ( 631 , "ः" , [ "ः" ]) failures += checkCase ( 632 , "ः̈" , [ "ः̈" ]) failures += checkCase ( 633 , "ः🇦" , [ "ः" , "🇦" ]) failures += checkCase ( 634 , "ः̈🇦" , [ "ः̈" , "🇦" ]) failures += checkCase ( 635 , "ः" , [ "ः" , "" ]) failures += checkCase ( 636 , "ः̈" , [ "ः̈" , "" ]) failures += checkCase ( 637 , "ःਃ" , [ "ःਃ" ]) failures += checkCase ( 638 , "ः̈ਃ" , [ "ः̈ਃ" ]) failures += checkCase ( 639 , "ःᄀ" , [ "ः" , "ᄀ" ]) failures += checkCase ( 640 , "ः̈ᄀ" , [ "ः̈" , "ᄀ" ]) failures += checkCase ( 641 , "ःᅠ" , [ "ः" , "ᅠ" ]) failures += checkCase ( 642 , "ः̈ᅠ" , [ "ः̈" , "ᅠ" ]) failures += checkCase ( 643 , "ःᆨ" , [ "ः" , "ᆨ" ]) failures += checkCase ( 644 , "ः̈ᆨ" , [ "ः̈" , "ᆨ" ]) failures += checkCase ( 645 , "ः가" , [ "ः" , "가" ]) failures += checkCase ( 646 , "ः̈가" , [ "ः̈" , "가" ]) failures += checkCase ( 647 , "ः각" , [ "ः" , "각" ]) failures += checkCase ( 648 , "ः̈각" , [ "ः̈" , "각" ]) failures += checkCase ( 649 , "ःः" , [ "ःः" ]) failures += checkCase ( 650 , "ः̈ः" , [ "ः̈ः" ]) failures += checkCase ( 651 , "ःऄ" , [ "ः" , "ऄ" ]) failures += checkCase ( 652 , "ः̈ऄ" , [ "ः̈" , "ऄ" ]) failures += checkCase ( 653 , "ःൎ" , [ "ः" , "ൎ" ]) failures += checkCase ( 654 , "ः̈ൎ" , [ "ः̈" , "ൎ" ]) failures += checkCase ( 655 , "ःक" , [ "ः" , "क" ]) failures += checkCase ( 656 , "ः̈क" , [ "ः̈" , "क" ]) failures += checkCase ( 657 , "ः⌚" , [ "ः" , "⌚" ]) failures += checkCase ( 658 , "ः̈⌚" , [ "ः̈" , "⌚" ]) failures += checkCase ( 659 , "ः̀" , [ "ः̀" ]) failures += checkCase ( 660 , "ः̈̀" , [ "ः̈̀" ]) failures += checkCase ( 661 , "ःऀ" , [ "ःऀ" ]) failures += checkCase ( 662 , "ः̈ऀ" , [ "ः̈ऀ" ]) failures += checkCase ( 663 , "ः्" , [ "ः्" ]) failures += checkCase ( 664 , "ः्̈" , [ "ः्̈" ]) failures } graphemecases10.tpz Check every published Unicode 16 grapheme test row import graphemesupport { checkCase } export function run () -> int { let mut failures = 0 failures += checkCase ( 665 , "ः" , [ "ः" ]) failures += checkCase ( 666 , "ः̈" , [ "ः̈" ]) failures += checkCase ( 667 , "ः" , [ "ः" , "" ]) failures += checkCase ( 668 , "ः̈" , [ "ः̈" , "" ]) failures += checkCase ( 669 , "ऄ " , [ "ऄ" , " " ]) failures += checkCase ( 670 , "ऄ̈ " , [ "ऄ̈" , " " ]) failures += checkCase ( 671 , "ऄ\r" , [ "ऄ" , "\r" ]) failures += checkCase ( 672 , "ऄ̈\r" , [ "ऄ̈" , "\r" ]) failures += checkCase ( 673 , "ऄ\n" , [ "ऄ" , "\n" ]) failures += checkCase ( 674 , "ऄ̈\n" , [ "ऄ̈" , "\n" ]) failures += checkCase ( 675 , "ऄ" , [ "ऄ" , "" ]) failures += checkCase ( 676 , "ऄ̈" , [ "ऄ̈" , "" ]) failures += checkCase ( 677 , "ऄ" , [ "ऄ" ]) failures += checkCase ( 678 , "ऄ̈" , [ "ऄ̈" ]) failures += checkCase ( 679 , "ऄ🇦" , [ "ऄ" , "🇦" ]) failures += checkCase ( 680 , "ऄ̈🇦" , [ "ऄ̈" , "🇦" ]) failures += checkCase ( 681 , "ऄ" , [ "ऄ" , "" ]) failures += checkCase ( 682 , "ऄ̈" , [ "ऄ̈" , "" ]) failures += checkCase ( 683 , "ऄਃ" , [ "ऄਃ" ]) failures += checkCase ( 684 , "ऄ̈ਃ" , [ "ऄ̈ਃ" ]) failures += checkCase ( 685 , "ऄᄀ" , [ "ऄ" , "ᄀ" ]) failures += checkCase ( 686 , "ऄ̈ᄀ" , [ "ऄ̈" , "ᄀ" ]) failures += checkCase ( 687 , "ऄᅠ" , [ "ऄ" , "ᅠ" ]) failures += checkCase ( 688 , "ऄ̈ᅠ" , [ "ऄ̈" , "ᅠ" ]) failures += checkCase ( 689 , "ऄᆨ" , [ "ऄ" , "ᆨ" ]) failures += checkCase ( 690 , "ऄ̈ᆨ" , [ "ऄ̈" , "ᆨ" ]) failures += checkCase ( 691 , "ऄ가" , [ "ऄ" , "가" ]) failures += checkCase ( 692 , "ऄ̈가" , [ "ऄ̈" , "가" ]) failures += checkCase ( 693 , "ऄ각" , [ "ऄ" , "각" ]) failures += checkCase ( 694 , "ऄ̈각" , [ "ऄ̈" , "각" ]) failures += checkCase ( 695 , "ऄः" , [ "ऄः" ]) failures += checkCase ( 696 , "ऄ̈ः" , [ "ऄ̈ः" ]) failures += checkCase ( 697 , "ऄऄ" , [ "ऄ" , "ऄ" ]) failures += checkCase ( 698 , "ऄ̈ऄ" , [ "ऄ̈" , "ऄ" ]) failures += checkCase ( 699 , "ऄൎ" , [ "ऄ" , "ൎ" ]) failures += checkCase ( 700 , "ऄ̈ൎ" , [ "ऄ̈" , "ൎ" ]) failures += checkCase ( 701 , "ऄक" , [ "ऄ" , "क" ]) failures += checkCase ( 702 , "ऄ̈क" , [ "ऄ̈" , "क" ]) failures += checkCase ( 703 , "ऄ⌚" , [ "ऄ" , "⌚" ]) failures += checkCase ( 704 , "ऄ̈⌚" , [ "ऄ̈" , "⌚" ]) failures += checkCase ( 705 , "ऄ̀" , [ "ऄ̀" ]) failures += checkCase ( 706 , "ऄ̈̀" , [ "ऄ̈̀" ]) failures += checkCase ( 707 , "ऄऀ" , [ "ऄऀ" ]) failures += checkCase ( 708 , "ऄ̈ऀ" , [ "ऄ̈ऀ" ]) failures += checkCase ( 709 , "ऄ्" , [ "ऄ्" ]) failures += checkCase ( 710 , "ऄ्̈" , [ "ऄ्̈" ]) failures += checkCase ( 711 , "ऄ" , [ "ऄ" ]) failures += checkCase ( 712 , "ऄ̈" , [ "ऄ̈" ]) failures += checkCase ( 713 , "ऄ" , [ "ऄ" , "" ]) failures += checkCase ( 714 , "ऄ̈" , [ "ऄ̈" , "" ]) failures += checkCase ( 715 , "ൎ " , [ "ൎ " ]) failures += checkCase ( 716 , "ൎ̈ " , [ "ൎ̈" , " " ]) failures += checkCase ( 717 , "ൎ\r" , [ "ൎ" , "\r" ]) failures += checkCase ( 718 , "ൎ̈\r" , [ "ൎ̈" , "\r" ]) failures += checkCase ( 719 , "ൎ\n" , [ "ൎ" , "\n" ]) failures += checkCase ( 720 , "ൎ̈\n" , [ "ൎ̈" , "\n" ]) failures += checkCase ( 721 , "ൎ" , [ "ൎ" , "" ]) failures += checkCase ( 722 , "ൎ̈" , [ "ൎ̈" , "" ]) failures += checkCase ( 723 , "ൎ" , [ "ൎ" ]) failures += checkCase ( 724 , "ൎ̈" , [ "ൎ̈" ]) failures += checkCase ( 725 , "ൎ🇦" , [ "ൎ🇦" ]) failures += checkCase ( 726 , "ൎ̈🇦" , [ "ൎ̈" , "🇦" ]) failures += checkCase ( 727 , "ൎ" , [ "ൎ" ]) failures += checkCase ( 728 , "ൎ̈" , [ "ൎ̈" , "" ]) failures } graphemecases11.tpz Check every published Unicode 16 grapheme test row import graphemesupport { checkCase } export function run () -> int { let mut failures = 0 failures += checkCase ( 729 , "ൎਃ" , [ "ൎਃ" ]) failures += checkCase ( 730 , "ൎ̈ਃ" , [ "ൎ̈ਃ" ]) failures += checkCase ( 731 , "ൎᄀ" , [ "ൎᄀ" ]) failures += checkCase ( 732 , "ൎ̈ᄀ" , [ "ൎ̈" , "ᄀ" ]) failures += checkCase ( 733 , "ൎᅠ" , [ "ൎᅠ" ]) failures += checkCase ( 734 , "ൎ̈ᅠ" , [ "ൎ̈" , "ᅠ" ]) failures += checkCase ( 735 , "ൎᆨ" , [ "ൎᆨ" ]) failures += checkCase ( 736 , "ൎ̈ᆨ" , [ "ൎ̈" , "ᆨ" ]) failures += checkCase ( 737 , "ൎ가" , [ "ൎ가" ]) failures += checkCase ( 738 , "ൎ̈가" , [ "ൎ̈" , "가" ]) failures += checkCase ( 739 , "ൎ각" , [ "ൎ각" ]) failures += checkCase ( 740 , "ൎ̈각" , [ "ൎ̈" , "각" ]) failures += checkCase ( 741 , "ൎः" , [ "ൎः" ]) failures += checkCase ( 742 , "ൎ̈ः" , [ "ൎ̈ः" ]) failures += checkCase ( 743 , "ൎऄ" , [ "ൎऄ" ]) failures += checkCase ( 744 , "ൎ̈ऄ" , [ "ൎ̈" , "ऄ" ]) failures += checkCase ( 745 , "ൎൎ" , [ "ൎൎ" ]) failures += checkCase ( 746 , "ൎ̈ൎ" , [ "ൎ̈" , "ൎ" ]) failures += checkCase ( 747 , "ൎक" , [ "ൎक" ]) failures += checkCase ( 748 , "ൎ̈क" , [ "ൎ̈" , "क" ]) failures += checkCase ( 749 , "ൎ⌚" , [ "ൎ⌚" ]) failures += checkCase ( 750 , "ൎ̈⌚" , [ "ൎ̈" , "⌚" ]) failures += checkCase ( 751 , "ൎ̀" , [ "ൎ̀" ]) failures += checkCase ( 752 , "ൎ̈̀" , [ "ൎ̈̀" ]) failures += checkCase ( 753 , "ൎऀ" , [ "ൎऀ" ]) failures += checkCase ( 754 , "ൎ̈ऀ" , [ "ൎ̈ऀ" ]) failures += checkCase ( 755 , "ൎ्" , [ "ൎ्" ]) failures += checkCase ( 756 , "ൎ्̈" , [ "ൎ्̈" ]) failures += checkCase ( 757 , "ൎ" , [ "ൎ" ]) failures += checkCase ( 758 , "ൎ̈" , [ "ൎ̈" ]) failures += checkCase ( 759 , "ൎ" , [ "ൎ" ]) failures += checkCase ( 760 , "ൎ̈" , [ "ൎ̈" , "" ]) failures += checkCase ( 761 , "क " , [ "क" , " " ]) failures += checkCase ( 762 , "क̈ " , [ "क̈" , " " ]) failures += checkCase ( 763 , "क\r" , [ "क" , "\r" ]) failures += checkCase ( 764 , "क̈\r" , [ "क̈" , "\r" ]) failures += checkCase ( 765 , "क\n" , [ "क" , "\n" ]) failures += checkCase ( 766 , "क̈\n" , [ "क̈" , "\n" ]) failures += checkCase ( 767 , "क" , [ "क" , "" ]) failures += checkCase ( 768 , "क̈" , [ "क̈" , "" ]) failures += checkCase ( 769 , "क" , [ "क" ]) failures += checkCase ( 770 , "क̈" , [ "क̈" ]) failures += checkCase ( 771 , "क🇦" , [ "क" , "🇦" ]) failures += checkCase ( 772 , "क̈🇦" , [ "क̈" , "🇦" ]) failures += checkCase ( 773 , "क" , [ "क" , "" ]) failures += checkCase ( 774 , "क̈" , [ "क̈" , "" ]) failures += checkCase ( 775 , "कਃ" , [ "कਃ" ]) failures += checkCase ( 776 , "क̈ਃ" , [ "क̈ਃ" ]) failures += checkCase ( 777 , "कᄀ" , [ "क" , "ᄀ" ]) failures += checkCase ( 778 , "क̈ᄀ" , [ "क̈" , "ᄀ" ]) failures += checkCase ( 779 , "कᅠ" , [ "क" , "ᅠ" ]) failures += checkCase ( 780 , "क̈ᅠ" , [ "क̈" , "ᅠ" ]) failures += checkCase ( 781 , "कᆨ" , [ "क" , "ᆨ" ]) failures += checkCase ( 782 , "क̈ᆨ" , [ "क̈" , "ᆨ" ]) failures += checkCase ( 783 , "क가" , [ "क" , "가" ]) failures += checkCase ( 784 , "क̈가" , [ "क̈" , "가" ]) failures += checkCase ( 785 , "क각" , [ "क" , "각" ]) failures += checkCase ( 786 , "क̈각" , [ "क̈" , "각" ]) failures += checkCase ( 787 , "कः" , [ "कः" ]) failures += checkCase ( 788 , "क̈ः" , [ "क̈ः" ]) failures += checkCase ( 789 , "कऄ" , [ "क" , "ऄ" ]) failures += checkCase ( 790 , "क̈ऄ" , [ "क̈" , "ऄ" ]) failures += checkCase ( 791 , "कൎ" , [ "क" , "ൎ" ]) failures += checkCase ( 792 , "क̈ൎ" , [ "क̈" , "ൎ" ]) failures } graphemecases12.tpz Check every published Unicode 16 grapheme test row import graphemesupport { checkCase } export function run () -> int { let mut failures = 0 failures += checkCase ( 793 , "कक" , [ "क" , "क" ]) failures += checkCase ( 794 , "क̈क" , [ "क̈" , "क" ]) failures += checkCase ( 795 , "क⌚" , [ "क" , "⌚" ]) failures += checkCase ( 796 , "क̈⌚" , [ "क̈" , "⌚" ]) failures += checkCase ( 797 , "क̀" , [ "क̀" ]) failures += checkCase ( 798 , "क̈̀" , [ "क̈̀" ]) failures += checkCase ( 799 , "कऀ" , [ "कऀ" ]) failures += checkCase ( 800 , "क̈ऀ" , [ "क̈ऀ" ]) failures += checkCase ( 801 , "क्" , [ "क्" ]) failures += checkCase ( 802 , "क्̈" , [ "क्̈" ]) failures += checkCase ( 803 , "क" , [ "क" ]) failures += checkCase ( 804 , "क̈" , [ "क̈" ]) failures += checkCase ( 805 , "क" , [ "क" , "" ]) failures += checkCase ( 806 , "क̈" , [ "क̈" , "" ]) failures += checkCase ( 807 , "⌚ " , [ "⌚" , " " ]) failures += checkCase ( 808 , "⌚̈ " , [ "⌚̈" , " " ]) failures += checkCase ( 809 , "⌚\r" , [ "⌚" , "\r" ]) failures += checkCase ( 810 , "⌚̈\r" , [ "⌚̈" , "\r" ]) failures += checkCase ( 811 , "⌚\n" , [ "⌚" , "\n" ]) failures += checkCase ( 812 , "⌚̈\n" , [ "⌚̈" , "\n" ]) failures += checkCase ( 813 , "⌚" , [ "⌚" , "" ]) failures += checkCase ( 814 , "⌚̈" , [ "⌚̈" , "" ]) failures += checkCase ( 815 , "⌚" , [ "⌚" ]) failures += checkCase ( 816 , "⌚̈" , [ "⌚̈" ]) failures += checkCase ( 817 , "⌚🇦" , [ "⌚" , "🇦" ]) failures += checkCase ( 818 , "⌚̈🇦" , [ "⌚̈" , "🇦" ]) failures += checkCase ( 819 , "⌚" , [ "⌚" , "" ]) failures += checkCase ( 820 , "⌚̈" , [ "⌚̈" , "" ]) failures += checkCase ( 821 , "⌚ਃ" , [ "⌚ਃ" ]) failures += checkCase ( 822 , "⌚̈ਃ" , [ "⌚̈ਃ" ]) failures += checkCase ( 823 , "⌚ᄀ" , [ "⌚" , "ᄀ" ]) failures += checkCase ( 824 , "⌚̈ᄀ" , [ "⌚̈" , "ᄀ" ]) failures += checkCase ( 825 , "⌚ᅠ" , [ "⌚" , "ᅠ" ]) failures += checkCase ( 826 , "⌚̈ᅠ" , [ "⌚̈" , "ᅠ" ]) failures += checkCase ( 827 , "⌚ᆨ" , [ "⌚" , "ᆨ" ]) failures += checkCase ( 828 , "⌚̈ᆨ" , [ "⌚̈" , "ᆨ" ]) failures += checkCase ( 829 , "⌚가" , [ "⌚" , "가" ]) failures += checkCase ( 830 , "⌚̈가" , [ "⌚̈" , "가" ]) failures += checkCase ( 831 , "⌚각" , [ "⌚" , "각" ]) failures += checkCase ( 832 , "⌚̈각" , [ "⌚̈" , "각" ]) failures += checkCase ( 833 , "⌚ः" , [ "⌚ः" ]) failures += checkCase ( 834 , "⌚̈ः" , [ "⌚̈ः" ]) failures += checkCase ( 835 , "⌚ऄ" , [ "⌚" , "ऄ" ]) failures += checkCase ( 836 , "⌚̈ऄ" , [ "⌚̈" , "ऄ" ]) failures += checkCase ( 837 , "⌚ൎ" , [ "⌚" , "ൎ" ]) failures += checkCase ( 838 , "⌚̈ൎ" , [ "⌚̈" , "ൎ" ]) failures += checkCase ( 839 , "⌚क" , [ "⌚" , "क" ]) failures += checkCase ( 840 , "⌚̈क" , [ "⌚̈" , "क" ]) failures += checkCase ( 841 , "⌚⌚" , [ "⌚" , "⌚" ]) failures += checkCase ( 842 , "⌚̈⌚" , [ "⌚̈" , "⌚" ]) failures += checkCase ( 843 , "⌚̀" , [ "⌚̀" ]) failures += checkCase ( 844 , "⌚̈̀" , [ "⌚̈̀" ]) failures += checkCase ( 845 , "⌚ऀ" , [ "⌚ऀ" ]) failures += checkCase ( 846 , "⌚̈ऀ" , [ "⌚̈ऀ" ]) failures += checkCase ( 847 , "⌚्" , [ "⌚्" ]) failures += checkCase ( 848 , "⌚्̈" , [ "⌚्̈" ]) failures += checkCase ( 849 , "⌚" , [ "⌚" ]) failures += checkCase ( 850 , "⌚̈" , [ "⌚̈" ]) failures += checkCase ( 851 , "⌚" , [ "⌚" , "" ]) failures += checkCase ( 852 , "⌚̈" , [ "⌚̈" , "" ]) failures += checkCase ( 853 , "̀ " , [ "̀" , " " ]) failures += checkCase ( 854 , "̀̈ " , [ "̀̈" , " " ]) failures += checkCase ( 855 , "̀\r" , [ "̀" , "\r" ]) failures += checkCase ( 856 , "̀̈\r" , [ "̀̈" , "\r" ]) failures } graphemecases13.tpz Check every published Unicode 16 grapheme test row import graphemesupport { checkCase } export function run () -> int { let mut failures = 0 failures += checkCase ( 857 , "̀\n" , [ "̀" , "\n" ]) failures += checkCase ( 858 , "̀̈\n" , [ "̀̈" , "\n" ]) failures += checkCase ( 859 , "̀" , [ "̀" , "" ]) failures += checkCase ( 860 , "̀̈" , [ "̀̈" , "" ]) failures += checkCase ( 861 , "̀" , [ "̀" ]) failures += checkCase ( 862 , "̀̈" , [ "̀̈" ]) failures += checkCase ( 863 , "̀🇦" , [ "̀" , "🇦" ]) failures += checkCase ( 864 , "̀̈🇦" , [ "̀̈" , "🇦" ]) failures += checkCase ( 865 , "̀" , [ "̀" , "" ]) failures += checkCase ( 866 , "̀̈" , [ "̀̈" , "" ]) failures += checkCase ( 867 , "̀ਃ" , [ "̀ਃ" ]) failures += checkCase ( 868 , "̀̈ਃ" , [ "̀̈ਃ" ]) failures += checkCase ( 869 , "̀ᄀ" , [ "̀" , "ᄀ" ]) failures += checkCase ( 870 , "̀̈ᄀ" , [ "̀̈" , "ᄀ" ]) failures += checkCase ( 871 , "̀ᅠ" , [ "̀" , "ᅠ" ]) failures += checkCase ( 872 , "̀̈ᅠ" , [ "̀̈" , "ᅠ" ]) failures += checkCase ( 873 , "̀ᆨ" , [ "̀" , "ᆨ" ]) failures += checkCase ( 874 , "̀̈ᆨ" , [ "̀̈" , "ᆨ" ]) failures += checkCase ( 875 , "̀가" , [ "̀" , "가" ]) failures += checkCase ( 876 , "̀̈가" , [ "̀̈" , "가" ]) failures += checkCase ( 877 , "̀각" , [ "̀" , "각" ]) failures += checkCase ( 878 , "̀̈각" , [ "̀̈" , "각" ]) failures += checkCase ( 879 , "̀ः" , [ "̀ः" ]) failures += checkCase ( 880 , "̀̈ः" , [ "̀̈ः" ]) failures += checkCase ( 881 , "̀ऄ" , [ "̀" , "ऄ" ]) failures += checkCase ( 882 , "̀̈ऄ" , [ "̀̈" , "ऄ" ]) failures += checkCase ( 883 , "̀ൎ" , [ "̀" , "ൎ" ]) failures += checkCase ( 884 , "̀̈ൎ" , [ "̀̈" , "ൎ" ]) failures += checkCase ( 885 , "̀क" , [ "̀" , "क" ]) failures += checkCase ( 886 , "̀̈क" , [ "̀̈" , "क" ]) failures += checkCase ( 887 , "̀⌚" , [ "̀" , "⌚" ]) failures += checkCase ( 888 , "̀̈⌚" , [ "̀̈" , "⌚" ]) failures += checkCase ( 889 , "̀̀" , [ "̀̀" ]) failures += checkCase ( 890 , "̀̈̀" , [ "̀̈̀" ]) failures += checkCase ( 891 , "̀ऀ" , [ "̀ऀ" ]) failures += checkCase ( 892 , "̀̈ऀ" , [ "̀̈ऀ" ]) failures += checkCase ( 893 , "्̀" , [ "्̀" ]) failures += checkCase ( 894 , "्̀̈" , [ "्̀̈" ]) failures += checkCase ( 895 , "̀" , [ "̀" ]) failures += checkCase ( 896 , "̀̈" , [ "̀̈" ]) failures += checkCase ( 897 , "̀" , [ "̀" , "" ]) failures += checkCase ( 898 , "̀̈" , [ "̀̈" , "" ]) failures += checkCase ( 899 , "ऀ " , [ "ऀ" , " " ]) failures += checkCase ( 900 , "ऀ̈ " , [ "ऀ̈" , " " ]) failures += checkCase ( 901 , "ऀ\r" , [ "ऀ" , "\r" ]) failures += checkCase ( 902 , "ऀ̈\r" , [ "ऀ̈" , "\r" ]) failures += checkCase ( 903 , "ऀ\n" , [ "ऀ" , "\n" ]) failures += checkCase ( 904 , "ऀ̈\n" , [ "ऀ̈" , "\n" ]) failures += checkCase ( 905 , "ऀ" , [ "ऀ" , "" ]) failures += checkCase ( 906 , "ऀ̈" , [ "ऀ̈" , "" ]) failures += checkCase ( 907 , "ऀ" , [ "ऀ" ]) failures += checkCase ( 908 , "ऀ̈" , [ "ऀ̈" ]) failures += checkCase ( 909 , "ऀ🇦" , [ "ऀ" , "🇦" ]) failures += checkCase ( 910 , "ऀ̈🇦" , [ "ऀ̈" , "🇦" ]) failures += checkCase ( 911 , "ऀ" , [ "ऀ" , "" ]) failures += checkCase ( 912 , "ऀ̈" , [ "ऀ̈" , "" ]) failures += checkCase ( 913 , "ऀਃ" , [ "ऀਃ" ]) failures += checkCase ( 914 , "ऀ̈ਃ" , [ "ऀ̈ਃ" ]) failures += checkCase ( 915 , "ऀᄀ" , [ "ऀ" , "ᄀ" ]) failures += checkCase ( 916 , "ऀ̈ᄀ" , [ "ऀ̈" , "ᄀ" ]) failures += checkCase ( 917 , "ऀᅠ" , [ "ऀ" , "ᅠ" ]) failures += checkCase ( 918 , "ऀ̈ᅠ" , [ "ऀ̈" , "ᅠ" ]) failures += checkCase ( 919 , "ऀᆨ" , [ "ऀ" , "ᆨ" ]) failures += checkCase ( 920 , "ऀ̈ᆨ" , [ "ऀ̈" , "ᆨ" ]) failures } graphemecases14.tpz Check every published Unicode 16 grapheme test row import graphemesupport { checkCase } export function run () -> int { let mut failures = 0 failures += checkCase ( 921 , "ऀ가" , [ "ऀ" , "가" ]) failures += checkCase ( 922 , "ऀ̈가" , [ "ऀ̈" , "가" ]) failures += checkCase ( 923 , "ऀ각" , [ "ऀ" , "각" ]) failures += checkCase ( 924 , "ऀ̈각" , [ "ऀ̈" , "각" ]) failures += checkCase ( 925 , "ऀः" , [ "ऀः" ]) failures += checkCase ( 926 , "ऀ̈ः" , [ "ऀ̈ः" ]) failures += checkCase ( 927 , "ऀऄ" , [ "ऀ" , "ऄ" ]) failures += checkCase ( 928 , "ऀ̈ऄ" , [ "ऀ̈" , "ऄ" ]) failures += checkCase ( 929 , "ऀൎ" , [ "ऀ" , "ൎ" ]) failures += checkCase ( 930 , "ऀ̈ൎ" , [ "ऀ̈" , "ൎ" ]) failures += checkCase ( 931 , "ऀक" , [ "ऀ" , "क" ]) failures += checkCase ( 932 , "ऀ̈क" , [ "ऀ̈" , "क" ]) failures += checkCase ( 933 , "ऀ⌚" , [ "ऀ" , "⌚" ]) failures += checkCase ( 934 , "ऀ̈⌚" , [ "ऀ̈" , "⌚" ]) failures += checkCase ( 935 , "ऀ̀" , [ "ऀ̀" ]) failures += checkCase ( 936 , "ऀ̈̀" , [ "ऀ̈̀" ]) failures += checkCase ( 937 , "ऀऀ" , [ "ऀऀ" ]) failures += checkCase ( 938 , "ऀ̈ऀ" , [ "ऀ̈ऀ" ]) failures += checkCase ( 939 , "ऀ्" , [ "ऀ्" ]) failures += checkCase ( 940 , "ऀ्̈" , [ "ऀ्̈" ]) failures += checkCase ( 941 , "ऀ" , [ "ऀ" ]) failures += checkCase ( 942 , "ऀ̈" , [ "ऀ̈" ]) failures += checkCase ( 943 , "ऀ" , [ "ऀ" , "" ]) failures += checkCase ( 944 , "ऀ̈" , [ "ऀ̈" , "" ]) failures += checkCase ( 945 , "् " , [ "्" , " " ]) failures += checkCase ( 946 , "्̈ " , [ "्̈" , " " ]) failures += checkCase ( 947 , "्\r" , [ "्" , "\r" ]) failures += checkCase ( 948 , "्̈\r" , [ "्̈" , "\r" ]) failures += checkCase ( 949 , "्\n" , [ "्" , "\n" ]) failures += checkCase ( 950 , "्̈\n" , [ "्̈" , "\n" ]) failures += checkCase ( 951 , "्" , [ "्" , "" ]) failures += checkCase ( 952 , "्̈" , [ "्̈" , "" ]) failures += checkCase ( 953 , "्" , [ "्" ]) failures += checkCase ( 954 , "्̈" , [ "्̈" ]) failures += checkCase ( 955 , "्🇦" , [ "्" , "🇦" ]) failures += checkCase ( 956 , "्̈🇦" , [ "्̈" , "🇦" ]) failures += checkCase ( 957 , "्" , [ "्" , "" ]) failures += checkCase ( 958 , "्̈" , [ "्̈" , "" ]) failures += checkCase ( 959 , "्ਃ" , [ "्ਃ" ]) failures += checkCase ( 960 , "्̈ਃ" , [ "्̈ਃ" ]) failures += checkCase ( 961 , "्ᄀ" , [ "्" , "ᄀ" ]) failures += checkCase ( 962 , "्̈ᄀ" , [ "्̈" , "ᄀ" ]) failures += checkCase ( 963 , "्ᅠ" , [ "्" , "ᅠ" ]) failures += checkCase ( 964 , "्̈ᅠ" , [ "्̈" , "ᅠ" ]) failures += checkCase ( 965 , "्ᆨ" , [ "्" , "ᆨ" ]) failures += checkCase ( 966 , "्̈ᆨ" , [ "्̈" , "ᆨ" ]) failures += checkCase ( 967 , "्가" , [ "्" , "가" ]) failures += checkCase ( 968 , "्̈가" , [ "्̈" , "가" ]) failures += checkCase ( 969 , "्각" , [ "्" , "각" ]) failures += checkCase ( 970 , "्̈각" , [ "्̈" , "각" ]) failures += checkCase ( 971 , "्ः" , [ "्ः" ]) failures += checkCase ( 972 , "्̈ः" , [ "्̈ः" ]) failures += checkCase ( 973 , "्ऄ" , [ "्" , "ऄ" ]) failures += checkCase ( 974 , "्̈ऄ" , [ "्̈" , "ऄ" ]) failures += checkCase ( 975 , "्ൎ" , [ "्" , "ൎ" ]) failures += checkCase ( 976 , "्̈ൎ" , [ "्̈" , "ൎ" ]) failures += checkCase ( 977 , "्क" , [ "्" , "क" ]) failures += checkCase ( 978 , "्̈क" , [ "्̈" , "क" ]) failures += checkCase ( 979 , "्⌚" , [ "्" , "⌚" ]) failures += checkCase ( 980 , "्̈⌚" , [ "्̈" , "⌚" ]) failures += checkCase ( 981 , "्̀" , [ "्̀" ]) failures += checkCase ( 982 , "्̈̀" , [ "्̈̀" ]) failures += checkCase ( 983 , "्ऀ" , [ "्ऀ" ]) failures += checkCase ( 984 , "्̈ऀ" , [ "्̈ऀ" ]) failures } graphemecases15.tpz Check every published Unicode 16 grapheme test row import graphemesupport { checkCase } export function run () -> int { let mut failures = 0 failures += checkCase ( 985 , "््" , [ "््" ]) failures += checkCase ( 986 , "््̈" , [ "््̈" ]) failures += checkCase ( 987 , "्" , [ "्" ]) failures += checkCase ( 988 , "्̈" , [ "्̈" ]) failures += checkCase ( 989 , "्" , [ "्" , "" ]) failures += checkCase ( 990 , "्̈" , [ "्̈" , "" ]) failures += checkCase ( 991 , " " , [ "" , " " ]) failures += checkCase ( 992 , "̈ " , [ "̈" , " " ]) failures += checkCase ( 993 , "\r" , [ "" , "\r" ]) failures += checkCase ( 994 , "̈\r" , [ "̈" , "\r" ]) failures += checkCase ( 995 , "\n" , [ "" , "\n" ]) failures += checkCase ( 996 , "̈\n" , [ "̈" , "\n" ]) failures += checkCase ( 997 , "" , [ "" , "" ]) failures += checkCase ( 998 , "̈" , [ "̈" , "" ]) failures += checkCase ( 999 , "" , [ "" ]) failures += checkCase ( 1000 , "̈" , [ "̈" ]) failures += checkCase ( 1001 , "🇦" , [ "" , "🇦" ]) failures += checkCase ( 1002 , "̈🇦" , [ "̈" , "🇦" ]) failures += checkCase ( 1003 , "" , [ "" , "" ]) failures += checkCase ( 1004 , "̈" , [ "̈" , "" ]) failures += checkCase ( 1005 , "ਃ" , [ "ਃ" ]) failures += checkCase ( 1006 , "̈ਃ" , [ "̈ਃ" ]) failures += checkCase ( 1007 , "ᄀ" , [ "" , "ᄀ" ]) failures += checkCase ( 1008 , "̈ᄀ" , [ "̈" , "ᄀ" ]) failures += checkCase ( 1009 , "ᅠ" , [ "" , "ᅠ" ]) failures += checkCase ( 1010 , "̈ᅠ" , [ "̈" , "ᅠ" ]) failures += checkCase ( 1011 , "ᆨ" , [ "" , "ᆨ" ]) failures += checkCase ( 1012 , "̈ᆨ" , [ "̈" , "ᆨ" ]) failures += checkCase ( 1013 , "가" , [ "" , "가" ]) failures += checkCase ( 1014 , "̈가" , [ "̈" , "가" ]) failures += checkCase ( 1015 , "각" , [ "" , "각" ]) failures += checkCase ( 1016 , "̈각" , [ "̈" , "각" ]) failures += checkCase ( 1017 , "ः" , [ "ः" ]) failures += checkCase ( 1018 , "̈ः" , [ "̈ः" ]) failures += checkCase ( 1019 , "ऄ" , [ "" , "ऄ" ]) failures += checkCase ( 1020 , "̈ऄ" , [ "̈" , "ऄ" ]) failures += checkCase ( 1021 , "ൎ" , [ "" , "ൎ" ]) failures += checkCase ( 1022 , "̈ൎ" , [ "̈" , "ൎ" ]) failures += checkCase ( 1023 , "क" , [ "" , "क" ]) failures += checkCase ( 1024 , "̈क" , [ "̈" , "क" ]) failures += checkCase ( 1025 , "⌚" , [ "" , "⌚" ]) failures += checkCase ( 1026 , "̈⌚" , [ "̈" , "⌚" ]) failures += checkCase ( 1027 , "̀" , [ "̀" ]) failures += checkCase ( 1028 , "̈̀" , [ "̈̀" ]) failures += checkCase ( 1029 , "ऀ" , [ "ऀ" ]) failures += checkCase ( 1030 , "̈ऀ" , [ "̈ऀ" ]) failures += checkCase ( 1031 , "्" , [ "्" ]) failures += checkCase ( 1032 , "्̈" , [ "्̈" ]) failures += checkCase ( 1033 , "" , [ "" ]) failures += checkCase ( 1034 , "̈" , [ "̈" ]) failures += checkCase ( 1035 , "" , [ "" , "" ]) failures += checkCase ( 1036 , "̈" , [ "̈" , "" ]) failures += checkCase ( 1037 , " " , [ "" , " " ]) failures += checkCase ( 1038 , "̈ " , [ "̈" , " " ]) failures += checkCase ( 1039 , "\r" , [ "" , "\r" ]) failures += checkCase ( 1040 , "̈\r" , [ "̈" , "\r" ]) failures += checkCase ( 1041 , "\n" , [ "" , "\n" ]) failures += checkCase ( 1042 , "̈\n" , [ "̈" , "\n" ]) failures += checkCase ( 1043 , "" , [ "" , "" ]) failures += checkCase ( 1044 , "̈" , [ "̈" , "" ]) failures += checkCase ( 1045 , "" , [ "" ]) failures += checkCase ( 1046 , "̈" , [ "̈" ]) failures += checkCase ( 1047 , "🇦" , [ "" , "🇦" ]) failures += checkCase ( 1048 , "̈🇦" , [ "̈" , "🇦" ]) failures } graphemecases16.tpz Check every published Unicode 16 grapheme test row import graphemesupport { checkCase } export function run () -> int { let mut failures = 0 failures += checkCase ( 1049 , "" , [ "" , "" ]) failures += checkCase ( 1050 , "̈" , [ "̈" , "" ]) failures += checkCase ( 1051 , "ਃ" , [ "ਃ" ]) failures += checkCase ( 1052 , "̈ਃ" , [ "̈ਃ" ]) failures += checkCase ( 1053 , "ᄀ" , [ "" , "ᄀ" ]) failures += checkCase ( 1054 , "̈ᄀ" , [ "̈" , "ᄀ" ]) failures += checkCase ( 1055 , "ᅠ" , [ "" , "ᅠ" ]) failures += checkCase ( 1056 , "̈ᅠ" , [ "̈" , "ᅠ" ]) failures += checkCase ( 1057 , "ᆨ" , [ "" , "ᆨ" ]) failures += checkCase ( 1058 , "̈ᆨ" , [ "̈" , "ᆨ" ]) failures += checkCase ( 1059 , "가" , [ "" , "가" ]) failures += checkCase ( 1060 , "̈가" , [ "̈" , "가" ]) failures += checkCase ( 1061 , "각" , [ "" , "각" ]) failures += checkCase ( 1062 , "̈각" , [ "̈" , "각" ]) failures += checkCase ( 1063 , "ः" , [ "ः" ]) failures += checkCase ( 1064 , "̈ः" , [ "̈ः" ]) failures += checkCase ( 1065 , "ऄ" , [ "" , "ऄ" ]) failures += checkCase ( 1066 , "̈ऄ" , [ "̈" , "ऄ" ]) failures += checkCase ( 1067 , "ൎ" , [ "" , "ൎ" ]) failures += checkCase ( 1068 , "̈ൎ" , [ "̈" , "ൎ" ]) failures += checkCase ( 1069 , "क" , [ "" , "क" ]) failures += checkCase ( 1070 , "̈क" , [ "̈" , "क" ]) failures += checkCase ( 1071 , "⌚" , [ "" , "⌚" ]) failures += checkCase ( 1072 , "̈⌚" , [ "̈" , "⌚" ]) failures += checkCase ( 1073 , "̀" , [ "̀" ]) failures += checkCase ( 1074 , "̈̀" , [ "̈̀" ]) failures += checkCase ( 1075 , "ऀ" , [ "ऀ" ]) failures += checkCase ( 1076 , "̈ऀ" , [ "̈ऀ" ]) failures += checkCase ( 1077 , "्" , [ "्" ]) failures += checkCase ( 1078 , "्̈" , [ "्̈" ]) failures += checkCase ( 1079 , "" , [ "" ]) failures += checkCase ( 1080 , "̈" , [ "̈" ]) failures += checkCase ( 1081 , "" , [ "" , "" ]) failures += checkCase ( 1082 , "̈" , [ "̈" , "" ]) failures += checkCase ( 1083 , "\r\na\n̈" , [ "\r\n" , "a" , "\n" , "̈" ]) failures += checkCase ( 1084 , "ä" , [ "ä" ]) failures += checkCase ( 1085 , " ن" , [ " " , "ن" ]) failures += checkCase ( 1086 , "ن " , [ "ن" , " " ]) failures += checkCase ( 1087 , "ᄀᄀ" , [ "ᄀᄀ" ]) failures += checkCase ( 1088 , "각ᄀ" , [ "각" , "ᄀ" ]) failures += checkCase ( 1089 , "각ᆨᄀ" , [ "각ᆨ" , "ᄀ" ]) failures += checkCase ( 1090 , "🇦🇧🇨b" , [ "🇦🇧" , "🇨" , "b" ]) failures += checkCase ( 1091 , "a🇦🇧🇨b" , [ "a" , "🇦🇧" , "🇨" , "b" ]) failures += checkCase ( 1092 , "a🇦🇧🇨b" , [ "a" , "🇦🇧" , "🇨" , "b" ]) failures += checkCase ( 1093 , "a🇦🇧🇨b" , [ "a" , "🇦" , "🇧🇨" , "b" ]) failures += checkCase ( 1094 , "a🇦🇧🇨🇩b" , [ "a" , "🇦🇧" , "🇨🇩" , "b" ]) failures += checkCase ( 1095 , "a" , [ "a" ]) failures += checkCase ( 1096 , "äb" , [ "ä" , "b" ]) failures += checkCase ( 1097 , "aःb" , [ "aः" , "b" ]) failures += checkCase ( 1098 , "ab" , [ "a" , "b" ]) failures += checkCase ( 1099 , "👶🏿👶" , [ "👶🏿" , "👶" ]) failures += checkCase ( 1100 , "a🏿👶" , [ "a🏿" , "👶" ]) failures += checkCase ( 1101 , "a🏿👶🛑" , [ "a🏿" , "👶🛑" ]) failures += checkCase ( 1102 , "👶🏿̈👶🏿" , [ "👶🏿̈👶🏿" ]) failures += checkCase ( 1103 , "🛑🛑" , [ "🛑🛑" ]) failures += checkCase ( 1104 , "a🛑" , [ "a" , "🛑" ]) failures += checkCase ( 1105 , "✁✁" , [ "✁✁" ]) failures += checkCase ( 1106 , "a✁" , [ "a" , "✁" ]) failures += checkCase ( 1107 , "कत" , [ "क" , "त" ]) failures += checkCase ( 1108 , "क्त" , [ "क्त" ]) failures += checkCase ( 1109 , "क््त" , [ "क््त" ]) failures += checkCase ( 1110 , "क्त" , [ "क्त" ]) failures += checkCase ( 1111 , "क़्त" , [ "क़्त" ]) failures += checkCase ( 1112 , "क़्त" , [ "क़्त" ]) failures } graphemecases17.tpz Check every published Unicode 16 grapheme test row import graphemesupport { checkCase } export function run () -> int { let mut failures = 0 failures += checkCase ( 1113 , "क्त्य" , [ "क्त्य" ]) failures += checkCase ( 1114 , "क्a" , [ "क्" , "a" ]) failures += checkCase ( 1115 , "a्त" , [ "a्" , "त" ]) failures += checkCase ( 1116 , "?्त" , [ "?्" , "त" ]) failures += checkCase ( 1117 , "क््त" , [ "क््त" ]) failures } Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout Unicode 16.0.0 grapheme corpus passed This exact example has not been executed.
Alternatives considered Provide scalar iteration alone. Programs would need to implement their own grapheme boundaries to work with visible characters.Why Text can be processed by grapheme without changing its underlying data.
Changed rules Choose Unicode grapheme clusters explicitly →
Existing string and array members carry their signatures forward Adopted November 14, 2026 · 6.0.0 · Being verified
Problem Programs moving to 6.0 need to know which built-in calls still work as written. Out-of-bounds array access is one common case.
Decision Keep the 5.21 signatures unless a separate decision removes or renames the member. Specify code Point At, split, and byte Length for strings, and get, push, map, filter, and reduce for arrays. Array. get(i) returns Option<T>. A negative index or one at or beyond the length returns None().Examples
Read scalar values by scalar index run · running · Verification · not-run
main.tpz Read scalar values by scalar index Open in Playground → import std.io function show (value: Option < int > ) -> string { match (value) { case Some(point) => "{point}" case None() => "none" } } let text = "a가😀" for index in ([ - 1 , 0 , 1 , 2 , 3 ]) { io. writeLine ( "{index}: { show (text. codePointAt (index))}" ) } Expected output Exit code 0
-1: none
0: 97
1: 44032
2: 128512
3: none
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout -1: none 0: 97 1: 44032 2: 128512 3: none This exact example has not been executed.
Compare scalar counts with UTF-8 byte counts run · running · Verification · not-run
main.tpz Compare scalar counts with UTF-8 byte counts Open in Playground → import std.io for text in ([ "" , "a" , "가" , "😀" , "a가😀" ]) { io. writeLine ( "{text. scalars ().length} {text. byteLength ()}" ) } Expected output Exit code 0
0 0
1 1
1 3
1 4
3 8
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Keep empty pieces between separators run · running · Verification · not-run
main.tpz Keep empty pieces between separators Open in Playground → import std.io function show (pieces: Array < string > ) -> string { "{pieces.length} [{pieces. join ("|")}]" } io. writeLine ( show ( "a,b,,c," . split ( "," ))) io. writeLine ( show ( "a::b" . split ( "::" ))) io. writeLine ( show ( "aaa" . split ( "aa" ))) io. writeLine ( show ( "plain" . split ( "," ))) io. writeLine ( show ( "" . split ( "," ))) let text = ",x," io. writeLine ( "{text. split (","). join (",") == text}" ) Expected output Exit code 0
5 [a|b||c|]
2 [a|b]
2 [|a]
1 [plain]
1 []
true
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout 5 [a|b||c|] 2 [a|b] 2 [|a] 1 [plain] 1 [] true This exact example has not been executed.
Read elements without faulting at the edges run · running · Verification · not-run
main.tpz Read elements without faulting at the edges Open in Playground → import std.io let names = [ "a" , "b" , "c" ] for index in ([ - 1 , 0 , 2 , 3 ]) { match (names. get (index)) { case Some(name) => io. writeLine ( "{index}: {name}" ) case None() => io. writeLine ( "{index}: none" ) } } let empty: Array < string > = [] io. writeLine ( "{empty.length}: {empty. get ( 0 ) ?? "none"}" ) Expected output Exit code 0
-1: none
0: a
2: c
3: none
0: none
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout -1: none 0: a 2: c 3: none 0: none This exact example has not been executed.
Append elements to a mutable array run · running · Verification · not-run
main.tpz Append elements to a mutable array Open in Playground → import std.io let mut names: Array < string > = [] io. writeLine ( "{names.length}" ) names. push ( "a" ) names. push ( "b" ) io. writeLine ( "{names.length}: {names. join (",")}" ) Expected output Exit code 0
0
2: a,b
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout This exact example has not been executed.
Alternatives considered Merge get into indexing or string split into regular-expression split. Optional access and faulting access have different results, and a literal delimiter serves a different purpose from a pattern.Redefine member names or signatures in 6.0. No change would leave fewer ways to say the same thing.Why Programs can keep their existing calls and choose an operation by the behavior they need.
Changed rules Read code points, byte counts and separated pieces →Read, count and append array elements →
String-to-integer conversion accepts ASCII digits and an optional minus Adopted November 14, 2026 · 6.0.0 · In progress
Problem When reading an integer from external text, a program needs to know whether whitespace or a plus sign is accepted. Out-of-range values also need a defined result.
Decision string. to Int() accepts ASCII decimal digits with an optional leading -.Whitespace, +, separators, prefixes, and out-of-range values produce None(). Examples
Parse a minus sign and decimal digits run · running · Verification · not-run
main.tpz Parse a minus sign and decimal digits Open in Playground → import std.io function show (text: string ) -> string { match (text. toInt ()) { case Some(value) => "{value}" case None() => "none" } } for text in ([ "42" , "-7" , "007" , "-0" , "9223372036854775807" , "-9223372036854775808" ]) { io. writeLine ( "[{text}] { show (text)}" ) } Expected output Exit code 0
[42] 42
[-7] -7
[007] 7
[-0] 0
[9223372036854775807] 9223372036854775807
[-9223372036854775808] -9223372036854775808
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout [42] 42 [-7] -7 [007] 7 [-0] 0 [9223372036854775807] 9223372036854775807 [-9223372036854775808] -9223372036854775808 This exact example has not been executed.
Return None() for other spellings and out-of-range values run · running · Verification · not-run
main.tpz Return None() for other spellings and out-of-range values Open in Playground → import std.io function show (text: string ) -> string { match (text. toInt ()) { case Some(value) => "{value}" case None() => "none" } } for text in ([ "" , "-" , "12a" , "1_000" , "0x10" , "1e3" , "١٢" , "9223372036854775808" , "-9223372036854775809" ]) { io. writeLine ( "[{text}] { show (text)}" ) } Expected output Exit code 0
[] none
[-] none
[12a] none
[1_000] none
[0x10] none
[1e3] none
[١٢] none
[9223372036854775808] none
[-9223372036854775809] none
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout [] none [-] none [12a] none [1_000] none [0x10] none [1e3] none [١٢] none [9223372036854775808] none [-9223372036854775809] none This exact example has not been executed.
Return None() for surrounding whitespace and a plus sign run · running · Verification · not-run
main.tpz Return None() for surrounding whitespace and a plus sign import std.io function show (text: string ) -> string { match (text. toInt ()) { case Some(value) => "{value}" case None() => "none" } } for text in ([ " 12" , "12 " , "+5" ]) { io. writeLine ( "[{text}] { show (text)}" ) } Expected output Exit code 0
[ 12] none
[12 ] none
[+5] none
Expected result Expected result Execution completes. Exit code 0.
No stderr.
Expected stdout [ 12] none [12 ] none [+5] none This exact example has not been executed.
Alternatives considered Trim whitespace and accept a leading +. That permits additional spellings of the same value.Why Callers can rely on a defined input spelling and failure result.
Changed rules Parse decimal integers with one spelling →