10 REM A DEF call takes one environment from the pool, exactly as 20 REM GOSUB does. It used to be owned by the funcdef and reset on every call, 30 REM which cost two silent defects: calls in one expression shared a slot, 40 REM and recursion never came back at all. 50 DEF FACT(N#) 60 IF N# <= 1 THEN RETURN 1 70 RETURN N# * FACT(N# - 1) 80 PRINT FACT(5) 90 REM Each frame keeps its own argument, which is what makes the unwind work. 100 DEF SUMTO(N#) 110 IF N# <= 0 THEN RETURN 0 120 RETURN N# + SUMTO(N# - 1) 130 PRINT SUMTO(4) 140 REM And two calls to one function in one expression no longer collide. 150 DEF DBL(N#) = N# * 2 160 PRINT DBL(10) + DBL(1) 170 PRINT DBL(1) + DBL(10) + DBL(100) 180 REM Depth answers to the environment pool, so runaway recursion reports 190 REM "Environment pool exhausted" rather than hanging. It is not exercised 200 REM here because the failed statement still prints junk afterwards; 210 REM this is a separate defect in TODO.md, and one this golden file 220 REM would pin if it went in. tests/user_functions.c asserts 230 REM the message instead.