Suite 177/177; self-hosting fixpoint OK (image
2,899,706 bytes). Tag v3-wrap-modules.
This step added the gm2/ISO channel-and-time wrapper modules that the current dialect can express, plus a showcase touring them alongside the session's earlier work.
| Step | Tag | Commit | What |
|---|---|---|---|
| wrappers | v3-wrap-modules |
05d9bd0 |
StdChans, TimeString, wrapclock, wraptime, wrapc |
| Showcase + docs | v3-wrap-modules |
(this commit) | showcase22, this summary |
(The same tag covers both, since the showcase is documentation of the step.)
| Module | What |
|---|---|
StdChans |
settable current channels (InChan/OutChan/ErrChan + setters) over IOChan; NullChan is a closed channel |
TimeString |
GetTimeString — local time as strftime("%c") |
wrapclock |
opaque timespec; timezone/istimezone/daylight/isdst/tzname; InitTimespec/KillTimespec, get/set fields, GetTimeRealtime/SetTimeRealtime |
wraptime |
opaque timeval/timezone/tm; gettimeofday/settimeofday, GetFractions, LocalTime, field accessors, SetTimeval/SetTimezone |
wrapc |
getrand, signbit/isfinite/isnan (f/l variants), SeekSet/SeekEnd, ReadOnly/WriteOnly, filesize/fileinode/filemtime, getusername, getnameuidgid, strtime |
The shim gains m2timestring and underscore-free m2wc*/m2wt*/
m2c* helpers (classic Modula-2 identifiers have no _, so the
helper names avoid it while the Modula-2-facing names match gm2).
wrapc.ReadOnly/WriteOnly return CARDINAL, not BITSET:
BITSET is not accepted as a function-result type in V3 (nor is
VAL(BITSET, n)).wraptime.localtime_r is spelled LocalTime — the _ is illegal
in a classic identifier.ChanConsts and StreamFile are written but not committed: their
read = FlagSet{readFlag} constants need typed set constructors
(T{lit}), which the frontend reports as not supported yet
(untyped literals with an inferred base, b := {r, w}, do work). Both
files remain on disk for the next step, which is a frontend change.
GenDevIF and DeviceTablePtr are not real gaps: they are not
present in the installed gm2 library set.
compiler/tests/showcase22.mod (Showcase22, exit 42) tours:
Bump uses total/done
before their VAR declaration;GetRec()^.a, GetArr()^[i];the wrapper library — StdChans.OutChan, a wrapclock timespec
roundtrip, a wraptime timeval+LocalTime, wrapc.getrand range and
signbit/isfinite, and TimeString.
showcase22 total=42
New: wrapprog.mod (the five modules, exit 42) and Showcase22.
cd .../m2compiler-V3
./bootstrap/fixpoint.sh # FIXPOINT OK
cd compiler && ./build.sh && ./run_tests.sh # 177/177
ChanConsts + StreamFile (typed set constructors); GOTO/labels;
generics; statement-context result suffixes; multiple inheritance
(deliberate).