Bug+Fix - 2dup

David McNab <[email protected]> Mon, 11 Oct 2004 14:24:02 +1300
Newsgroups gmane.comp.lang.forth.picforth
Message-ID <[email protected]>
Hi all

Enclosed is a patch against picforth.fs which fixes:
  - 2dup
     - was incorrectly doing ( x y -- x y x y y )
  - pic'quit
     - changed to just call (quit)
     - my gforth 0.5.0 doesn't have (query)

-- 
Cheers
David

_______________________________________________
PicForth mailing list
[email protected]
http://lists.rfc1149.net/mailman/listinfo/picforth
picforth-fix-2dup.patch (text/x-diff, 800 B)
--- picforth.fs	2004-03-12 11:26:07.000000000 +1300
+++ picforth.fixed	2004-10-11 14:19:11.000000000 +1300
@@ -1288,7 +1288,9 @@
 
 : 2dup
   s" suspend-interrupts" evaluate
-  popw w>tmp2 loadw w>tmp1 pushw tmp2>w pushw tmp1>w pushw tmp2>w pushw
+  popw w>tmp2 loadw w>tmp1
+  \ pushw \ bug - pulled out by David McNab
+  tmp2>w pushw tmp1>w pushw tmp2>w pushw
   s" restore-interrupts" evaluate
 ;
 
@@ -2044,7 +2046,8 @@
     begin ?stack name dup while parser repeat
     2drop ;
 
-: pic'quit ( -- ) begin .status cr (query) interpret prompt again ;
+\ : pic'quit ( -- ) begin .status cr (query) interpret prompt again ;
+: pic'quit (quit) ;
 
 \ ----------------------------------------------------------------------
 \ The following fragment comes from or is strongly inspired by gforth 0.6.1