Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!lll-winken!uwm.edu!spool.mu.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!unix.cis.pitt.edu!pitt!willett!ForthNet From: ForthNet@willett.pgh.pa.us (ForthNet articles from GEnie) Newsgroups: comp.lang.forth Subject: What's WRONG with Forth? Message-ID: <2417.UUL1.3#5129@willett.pgh.pa.us> Date: 27 Feb 91 03:08:40 GMT Organization: (n.) to be organized. But that's not important right now. Lines: 32 Category 2, Topic 9 Message 48 Tue Feb 26, 1991 ATFURMAN [Alan F.] at 01:49 PST For fast relief from stack balance headaches, try this: After writing a definition with before-and-after stack comments (you DO use before-and-after stack comments, don't you?...of course you do) read through the definition while thinking of, or mumbling, the stack depth as you read each word within the definition. The final stack depth should agree with the "after" stack comment. Example: : foo ( n1 n2 -- n3) * 3 + x @ / dup . ; Here is how the read-through would go (start with depth of 2): * 3 + x @ / dup . "two" "one" "two" "one" "two" "two" "one" "two" "one" Starting with a two-deep stack, we end with a one-deep stack, and conclude that the word's behavior conforms to the stack comment. When there are conditional branches or loops, this becomes trickier to do--but even more worth the trouble, too. ----- This message came from GEnie via willett. You *cannot* reply to the author using e-mail. Please post a follow-up article, or use any instructions the author may have included (USMail addresses, telephone #, etc.). Report problems to: dwp@willett.pgh.pa.us _or_ uunet!willett!dwp