lib: fmt fprint family over io.handle; remove the fdsink workaround (#5)

Graduates the fmt fprint family (fprint/fprintf/fprintln/fprintfln + internal putbytes/writeone/format*) from io.stream to io.handle, so a file (fd) prints directly through io.write's file-arm (commit-1). Removes the fdsink placeholder -- the fake-stream-vtable-over-os.write shim that stood in for the missing handle. The 8 stdio wrappers route over os.STD{OUT,ERR}_FILENO (new i32 filenos in lib/os; os is the import floor, so it can't hold an io.file-typed handle like Hare's os::stdout_file -- consumers cast i32 to io.file). Migrates the fd-shim sentinel tests 777/780/781 to fprint-over-handle as their headers designed, cstage-only per the pre-existing #209 (fmt is wwstage-uncompilable). Regenerates the 6 os-embedding combined.ww.
This commit is contained in:
2026-05-31 18:51:12 +09:00
parent 06c00e0e1b
commit 497f1fa0d3
15 changed files with 348 additions and 384 deletions

View File

@@ -29,7 +29,7 @@ Signatures mirror Hare too, modulo:
- Call-site variadic sugar matches Hare. `fn f(args: T...)` declares
a Hare-style variadic; call sites either gather N args into a
fresh `[]T` (`fmt.println(42, "hi", true)`) or forward an existing
slice with `xs...` (`fdprintln(fd, args...)`). The bare `T...` form
slice with `xs...` (`fprintln(h, args...)`). The bare `T...` form
in tagged unions still means spread-flatten (`(...inner | E)`);
the two uses don't overlap because `T...` only attaches to a
*param* decl. `lib/fmt` ships both the print family (`print` /