nightly-20260702
Pre-release
Pre-release
Added
- pb36 first-class functions: procedures are values, delegates and events invoke like SUBs + implicit address-of: a bare procedure name assigned to a delegate-typed (or DWORD) variable or added to an event takes its address - f = Triple / OnClick += Log1 need no CODEPTR32 (TryImplicitCodePtr, applied only when the name is not a variable, so a pointer-holding DWORD stays as-is) + event raising is just invoking: OnClick(42), OnClick 42 and CALL OnClick(42) are all equivalent to RAISE OnClick(42) - BindCallStatement routes an event-named call through the shared BuildRaiseGroup + delegate-typed variables invoke like SUBs in statement position: x 15 / CALL x(15) / x(15) route through the typed pointer-call path (ProcPtrStatementCalls side-table -> EmitProcPtrCall, closure env included); a FUNCTION delegate's discarded result stays balanced (float popped, owned string freed) + statement-bodied SUB lambdas: DIM x = SUB(y AS INTEGER) PRINT y * 2 lifts to an anonymous SUB (LambdaExpr.StatementBody); the DIM infers a full delegate type from the lambda's signature so x is immediately callable; lambda parameters are BYVAL by default (delegate params are values; pb36-only, no legacy BYREF expectation) # a SUB lambda's lifted proc no longer gets a result variable with a null type (BindLambdaBodies crashed codegen with an NRE in LayoutFrame) + array slice spreads: ..b(lo TO hi) inside an array literal spreads a slice of another static array - either bound omissible (LBOUND/UBOUND) or from-end ^n, e.g. DIM a = {1, ..b(0 TO 2), ..b(TO ^5), 5..9, ..c(^2 TO)}; bounds are compile-time constants, each slice expands to per-element reads (verified: exact expected element sequence at runtime, identical after the pb35 round-trip) # back-emitter ScopeSymbol now also probes the "name()" array key, so a slice-initialized module array's DIM keeps its bounds under pb35 * the back-emitter renders statement delegate calls as BYVAL arg temps + CALL DWORD (ptr)(...) (result temp only for FUNCTION delegates, matching the thunk shape) * docs/PB36.md documents first-class functions and slice spreads; docs/DECOMPILATION.md regenerated - 52 examples, 47 identical-output round-trips (both new features round-trip), 4 pb35-inexpressible unchanged + 4 round-trip tests (event-call syntaxes, SUB lambda + direct invocation, implicit CODEPTR32, slice expansion incl. from-end); all 2188 unit tests green, 246/246 corpus compile-clean; end-to-end verified output 1|2|3|4|30|40|24 for the first-class program and the exact slice sequence (d9d86c9)