Skip to content

Commit

Permalink
Added x-drop word.
Browse files Browse the repository at this point in the history
  • Loading branch information
cstrainge committed Nov 11, 2024
1 parent 22b4351 commit 7a750d0
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions std.f
Original file line number Diff line number Diff line change
Expand Up @@ -433,19 +433,28 @@ ( function into the bytecode stream being generated. )

: 3drop description: "Drop the top three items from the stack."
signature: "a b -- "
drop
drop
drop
3 x-drop
;



: 4drop description: "Drop the top two items from the stack."
signature: "a b -- "
drop
drop
drop
drop
4 x-drop
;



: x-drop description: "Drop the top n items from the stack."
signature: "count -- "
variable! count

begin
count @ 0 >
while
drop
count --!
repeat
;


Expand Down

0 comments on commit 7a750d0

Please sign in to comment.