Tags v3-showcase14 (program) and v3-showcase14-summary (this doc).
Suite 127/127; fixpoint OK (2,071,330 bytes).
compiler/tests/showcase14.mod (Showcase14) links seven modules and
exercises everything added this session:
IMPORT SysIO, TextIO, Utf8, Conversions, RealIO, ProgramArgs, IOChan;
TYPE Color = (red, green, blue),
CONST Favourite = blue; a literal as a CASE label, ordinal
ordering (red < green), and a CONST initialiser."abc" = "abc", "abc" # "abd".Utf8.Decode("é", 0, cp, next) (strict RFC 3629)
back to UCHAR, checked with UORD(cp) = 233.StrToInt("-56") and StrToReal("3.5")
round-trips; IntToStr used to render the result.ArgCount() (run with no arguments).WriteReal(3.5) and
UWriteString(U"ok ✓") (UTF-8).StdErrChan diagnostics via the channel handle.Each check adds to an accumulator; the program prints and exits with it (42).
showcase14 n=42
3.500000E+00 ok ✓
(stdout; the IOChan line goes to stderr so that stdio buffering does
not reorder it against the unbuffered shim writes).
expect_run_files_out Showcase14 42 "showcase14 n=42" … with the
Utf8/SysShim/sysio/textio/conversions/realio/programargs/
iochan definitions and bodies.
| Area | Where |
|---|---|
| Enums in expressions/CASE/CONST/params | docs/summary_lang-polish.md (v3-lang-polish) |
String =/# |
same |
Unicode UCHAR/UString/Utf8/TextIO.U* |
docs/summary_unicode.md (v3-unicode-1/-2) |
Conversions / RealIO |
docs/summary_stdlib-conversions.md |
ProgramArgs / IOChan |
docs/summary_programargs-iochan.md |
compiler/tests/showcase14.mod, compiler/run_tests.sh,
docs/summary_showcase14.md.