skipped if idea

This commit is contained in:
Richard Thier 2025-01-28 16:46:17 +01:00
parent fb236bd835
commit e442729e05

View File

@ -60,3 +60,17 @@
gen(zero) gen(zero)
branchcall branchcall
; ;
// Alternatively I can just add a "branchskip" to the list of predefined words and way to just count words and geninline(..)
::builtin if
geninline()
genpush(_)
countwords{}
genpush(_)
countwords[] // returns 0 if there was no block (its SKIP to 'branchskip' 0)
genpush(_)
gen(branchskip)
;
// This is not only simpler, but one can implement branchcall via a tiny bit of branchskip and a call to be honest...
// Also I feel like this results in bytecode with much better cache locality.