forth: [, ], STATE, EVALUATE (+5; Hayes 463→477, 74%)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled

This commit is contained in:
2026-04-25 01:23:23 +00:00
parent 89a879799a
commit b1a7852045
5 changed files with 81 additions and 15 deletions

View File

@@ -201,6 +201,31 @@
": A 5 ; BL WORD A FIND SWAP DROP"
-1)))
(define
forth-p5-state-tests
(fn
()
(forth-p5-check-top
"STATE @ in interpret mode"
"STATE @"
0)
(forth-p5-check-top
"STATE @ via IMMEDIATE inside compile"
": GT8 STATE @ ; IMMEDIATE : T GT8 LITERAL ; T"
-1)
(forth-p5-check-top
"[ ] LITERAL captures"
": SEVEN [ 7 ] LITERAL ; SEVEN"
7)
(forth-p5-check-top
"EVALUATE in interpret mode"
"S\" 5 7 +\" EVALUATE"
12)
(forth-p5-check-top
"EVALUATE inside def"
": A 100 ; : B S\" A\" EVALUATE ; B"
100)))
(define
forth-p4-check-output-passthrough
(fn
@@ -221,6 +246,7 @@
(forth-p5-double-tests)
(forth-p5-format-tests)
(forth-p5-dict-tests)
(forth-p5-state-tests)
(dict
"passed"
forth-p5-passed