Path: utzoo!attcan!uunet!samsung!zaphod.mps.ohio-state.edu!wuarchive!mit-eddie!rutgers!rochester!pt.cs.cmu.edu!dsl.pitt.edu!pitt!willett!ForthNet From: ForthNet@willett.pgh.pa.us (ForthNet articles from GEnie) Newsgroups: comp.lang.forth Subject: Non-Forth systems/languages. Message-ID: <1910.UUL1.3#5129@willett.pgh.pa.us> Date: 25 Oct 90 02:18:56 GMT Organization: String, Scotch tape, and Paperclips. (in Pgh, PA) Lines: 64 Date: 10-23-90 (03:45) Number: 4083 (Echo) To: GARY SMITH Refer#: 4064 From: GENE LEFAVE Read: NO Subj: NON-FORTH SYSTEMS/LANGUAG Status: PUBLIC MESSAGE This is a reply to: GS> From: schmidtg@iccgcc.decnet.ab.com GS> Newsgroups: comp.lang.forth GS> Subject: How do I do this in FORTH? GS> Message-ID: <1450.2719bf62@iccgcc.decnet.ab.com> GS> Date: 15 Oct 90 18:53:38 GMT GS> GS> invocation. The problem I am encountering in Forth is the difficulty GS> of accessing seven variables on the stack while still using the GS> stack for intermediate results. Forth seems to do well when the My technique for handling recursion is to use the dictionary like a stack frame. First I make up a defining word that accesses the disctionary relative to it's top. Then I just comma that arguments at the beginning of the word and un' ALLOT them at the end. Example: : IS CREATE , DOES> @ HERE + ( @ ) ; ( Add the @ if it needs to work like a constant. ) ( I usually make it a ;CODE word for speed.) -2 IS E or -1 CELLS IS E -4 IS D -6 IS C -8 IS B -10 IS A : ROUTINE ( a b c d e f ) 5 0 DO , LOOP ( or , , , , , ) ( body of code can use A @ B @ C @ etc. ) a' b' c' d' e' RECURSE ( Recursive call.) -10 ALLOT ; ( Exit ) I sometimes put my stack frame in PAD, or in a special area (in the case of strings.) In my multiuser enviorment I have to be real careful about using any variables. I can't read "C" very well but I trust that this answers your general question. Gene It's a miracle to me how this can possibly get back to USENET but I hope that it will. --- ~ EZ-Reader 1.13 ~ ----- This message came from GEnie via willett through a semi-automated process. Report problems to: dwp@willett.pgh.pa.us or uunet!willett!dwp