Path: utzoo!attcan!uunet!wuarchive!zaphod.mps.ohio-state.edu!usc!ucsd!ucbvax!MITCH.ENG.SUN.COM!wmb From: wmb@MITCH.ENG.SUN.COM Newsgroups: comp.lang.forth Subject: Interpret/compile consistency Message-ID: <9009211313.AA26438@ucbvax.Berkeley.EDU> Date: 20 Sep 90 15:30:35 GMT Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: wmb%MITCH.ENG.SUN.COM@SCFVM.GSFC.NASA.GOV Organization: The Internet Lines: 25 > The question I have at this point is what weight should be given to the > consistency position you cite in your new-user case. I assume you also > have problems explaining why IF THEN DO LOOP and so on also > don't work if interpreted? Not any more. I fixed them so that they do work if interpreted. It is remarkably easy to do; the trick is to switch to compile state when the beginning of a control structure is encountered, and execute the temporary definition when that control structure is completed. I wrote a paper about this that was published in the 1987 (I think) FORML proceedings, and John Hayes recently published an extension of same in Forth Dimensions (issue before last). The whole mechanism for interpreted conditionals adds 200 bytes to the Forth system. The reason I was motivated to work out this interpreted control structure scheme was because I was trying to explain to a new Forth user (who happens to be a world-class C programmer) why control structures don't work in interpret state. He persisted in thinking it was stupid that Forth was inconsistent in this respect, and I discovered that I agreed with him. So I fixed it. I would also note that >R and R> can be used in interpret state in the latest version of my system. Mitch