lib+test: unify errors to Hare named-void tagged-union
Five tags from ref/hare/errors/common.ha — invalid, noaccess, noentry, exists, unsupported — all !void. lib/io keeps eof/closed as plain void (no Hare analogue for ww's singleton-style done) and adds underread. Drops errors.equal/isnil and the old str-sentinel surface.
This commit is contained in:
@@ -40,8 +40,9 @@ export fn readbyte(b: *buf) (i32 | void) = {
|
||||
|
||||
// Distinct alias so `(str | linerr)` has two variant types the
|
||||
// tagged-union machinery can keep apart at the tag level. The error
|
||||
// variant carries a short description; callers compare with errors.equal
|
||||
// or just inspect by length.
|
||||
// variant carries a short description; callers inspect by length.
|
||||
// Placeholder until bufio graduates to io.stream + named-void tags
|
||||
// (eof / closed / underread).
|
||||
type linerr = str;
|
||||
|
||||
// readline — Hare-style fallible line read (name transliterated from
|
||||
|
||||
Reference in New Issue
Block a user