Implemented FILL and ERASE.
authorTim Vaughan <tgvaughan@gmail.com>
Mon, 2 May 2016 11:53:19 +0000 (23:53 +1200)
committerTim Vaughan <tgvaughan@gmail.com>
Mon, 2 May 2016 11:53:19 +0000 (23:53 +1200)
src/lib.4th

index 38a8d14..ad6a3a5 100644 (file)
         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 ------------------------------------------------------ )