The Lambda Lab
/
projects
/
forth.jl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9760c96
)
Implemented FILL and ERASE.
author
Tim Vaughan
<tgvaughan@gmail.com>
Mon, 2 May 2016 11:53:19 +0000
(23:53 +1200)
committer
Tim Vaughan
<tgvaughan@gmail.com>
Mon, 2 May 2016 11:53:19 +0000
(23:53 +1200)
src/lib.4th
patch
|
blob
|
history
diff --git
a/src/lib.4th
b/src/lib.4th
index
38a8d14
..
ad6a3a5
100644
(file)
--- a/
src/lib.4th
+++ b/
src/lib.4th
@@
-523,6
+523,17
@@
THEN
;
+( Fill u ints, starting at a, with the value b )
+: FILL ( a u b -- )
+ -ROT OVER + SWAP ?DO
+ DUP I !
+ LOOP
+ DROP
+;
+
+: ERASE ( a u -- )
+ 0 FILL
+;
( PRINTING THE DICTIONARY ------------------------------------------------------ )