mirror of
https://github.com/nineties/planckforth
synced 2024-12-26 21:58:42 +01:00
Add "rangeof"
This commit is contained in:
parent
73e0b64c2c
commit
0becf86f75
1 changed files with 16 additions and 0 deletions
16
core.fs
16
core.fs
|
@ -721,6 +721,22 @@ alias-builtin xor ^
|
||||||
compile drop
|
compile drop
|
||||||
; immediate
|
; immediate
|
||||||
|
|
||||||
|
\ <value> a b rangeof <body> endof
|
||||||
|
\ Execute <body> when
|
||||||
|
\ a <= <value> and <value> <= b
|
||||||
|
: rangeof
|
||||||
|
compile 2
|
||||||
|
compile pick
|
||||||
|
compile >=
|
||||||
|
compile swap
|
||||||
|
compile 2
|
||||||
|
compile pick
|
||||||
|
compile <=
|
||||||
|
compile and
|
||||||
|
[compile] if
|
||||||
|
compile drop
|
||||||
|
; immediate
|
||||||
|
|
||||||
\ compile: ( orig1 -- orig2 )
|
\ compile: ( orig1 -- orig2 )
|
||||||
: endof
|
: endof
|
||||||
[compile] else
|
[compile] else
|
||||||
|
|
Loading…
Reference in a new issue