Surfaced by
standards#284 — AffineScript port of `check-ts-allowlist.ts` (TS->AS migration STEP 2 tail-batch-1, #239 umbrella).
Behaviour
```affine
let a: String = "abc"
let b: String = "abd"
if a < b { ... } // ERROR: TypeMismatch (String, Int)
```
`<` / `>` / `<=` / `>=` work for `Int` and `Float` (unified per [[feedback_affinescript_no_ocaml_float_ops]]) but do not have a String overload for lexicographic comparison.
Why this hurts
Several scripts in the estate sort string lists or compare path prefixes byte-by-byte. The standards#284 port had to inline a manual `str_lt` helper using `char_to_int(string_get(...))` for every `<` use site. Every future TS->AS port that touches sort/order will hit the same wall.
Proposed fix
Add String overloads for `< > <= >=` that lower to byte-wise lex compare. Pattern follows the existing `String ==` / `!=` overloads. Should resolve in `Typecheck.binop_resolve` (or wherever the existing integer-comparison handler lives).
Alternative: ship a `String.lt` / `String.compare` stdlib function in `stdlib/String.affine`. Worse ergonomics (`String.lt a b` vs `a < b`) but smaller compiler change.
Acceptance
Refs
- standards#284 (work-around in `scripts/check-ts-allowlist.affine` `str_lt`)
- standards#239 (TS->AS campaign umbrella)
Surfaced by
standards#284 — AffineScript port of `check-ts-allowlist.ts` (TS->AS migration STEP 2 tail-batch-1, #239 umbrella).
Behaviour
```affine
let a: String = "abc"
let b: String = "abd"
if a < b { ... } // ERROR: TypeMismatch (String, Int)
```
`<` / `>` / `<=` / `>=` work for `Int` and `Float` (unified per [[feedback_affinescript_no_ocaml_float_ops]]) but do not have a String overload for lexicographic comparison.
Why this hurts
Several scripts in the estate sort string lists or compare path prefixes byte-by-byte. The standards#284 port had to inline a manual `str_lt` helper using `char_to_int(string_get(...))` for every `<` use site. Every future TS->AS port that touches sort/order will hit the same wall.
Proposed fix
Add String overloads for `< > <= >=` that lower to byte-wise lex compare. Pattern follows the existing `String ==` / `!=` overloads. Should resolve in `Typecheck.binop_resolve` (or wherever the existing integer-comparison handler lives).
Alternative: ship a `String.lt` / `String.compare` stdlib function in `stdlib/String.affine`. Worse ergonomics (`String.lt a b` vs `a < b`) but smaller compiler change.
Acceptance
Refs