Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!cs.utexas.edu!uunet!willett!dwp From: dwp@willett.UUCP (Doug Philips) Newsgroups: comp.lang.forth Subject: New Directions: Forth is not postfix Message-ID: <284.UUL1.3#5129@willett.UUCP> Date: 19 Jan 90 14:58:02 GMT Organization: Latest Link in ForthNet Chain (Pittsburgh, PA) Lines: 42 Let me say right off that I am *not* proposing any of this for ANSI Forth. One of the things that is an annoying inconsistency is that Forth is not fully postfix. The words ':', 'IF', 'DO', 'ELSE' etc. are prefix. Has anyone out there done real postfix forth? For example: {{ I . }} 10 0 ITERATE where '{{' and '}}' make a nameless word and push its address (say in whatever form @EXECUTE needs) on the stack. Of course one could always do something to the effect of: ['] Foo 10 0 ITERATE but having to name every 'closure' would be a pain, not to mention confusing and unnecessary. (Assume that ['] is right for @EXECUTE) IF ELSE THEN might be: else-addr then-addr condition IF-THEN-ELSE IF THEN might be: then-addr condition IF-THEN One of the benefits to this is that UNLOOP is just a plain exit. One of the drawbacks to this is that it highlights Forth's lack of paradigm for doing controlled exits of more than just the immediately enclosing construct, as in: ... {{ ... EXIT-:-WE-ARE-IN CheckError IF-THEN ... }} 100 0 ITERATE ... <> -Doug --- Fastest: (willett!dwp@gateway.sei.cmu.edu OR ...!sei!willett!dwp) ...!{uunet,nfsun,sei}!willett!dwp [in a pinch: dwp@vega.fac.cs.cmu.edu]