Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uunet!zephyr.ens.tek.com!tekcrl!tekgvs!toma From: toma@tekgvs.LABS.TEK.COM (Tom Almy) Newsgroups: comp.lang.forth Subject: Re: ANS FORTH/PICK and ROLL Message-ID: <6367@tekgvs.LABS.TEK.COM> Date: 15 Nov 89 19:30:28 GMT References: <931@mtk.UUCP> Reply-To: toma@tekgvs.LABS.TEK.COM (Tom Almy) Distribution: usa Organization: Tektronix, Inc., Beaverton, OR. Lines: 26 In article <931@mtk.UUCP> marmar@mtk.UUCP (Mark Martino) writes: >This article proposed that PICK and ROLL become members of the extended >word set instead of being required words. I agree with the article that >they are fairly cumbersome, but I could not think of a way to get along >without them. > >How WOULD you get along without them? Well I guess that this makes me really old, but I used Forth before there was PICK and ROLL, and I got along just fine! Two reasons to avoid them: 1) If you "need" them, then you are dealing with two many values at once on the stack, and will have an extremely difficult time debugging and especially maintaining that code. 2) Optimizing Forth compilers (such as my native code compilers) make use of machine registers to hold top of stack values. When PICK and ROLL have a non literal argument (i.e. X @ PICK rather than 4 PICK) then the compiler is forced to flush registers to the stack -- a decidedly non-optimal situation. Tom Almy toma@tekgvs.labs.tek.com Standard Disclaimers Apply