Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!bloom-beacon!husc6!uwvax!umn-d-ub!gandreas From: gandreas@umn-d-ub.D.UMN.EDU (Glenn Andreas) Newsgroups: comp.lang.forth Subject: Re: Infix operators Keywords: Parallel, controllers Message-ID: <472@umn-d-ub.D.UMN.EDU> Date: 29 Aug 88 14:24:00 GMT References: <8808121826.AA23206@jade.berkeley.edu> <1575@crete.cs.glasgow.ac.uk> <6882@well.UUCP> <1581@crete.cs.glasgow.ac.uk> <4057@juniper.uucp> Reply-To: gandreas@ub.d.umn.edu.UUCP (Glenn Andreas) Organization: University of Minnesota, Duluth Lines: 59 In article <4057@juniper.uucp> olorin@juniper.UUCP (David Weinstein) writes: >In article <1581@crete.cs.glasgow.ac.uk> orr@cs.glasgow.ac.uk (Fraser Orr) writes: >[...] >>never done such programming in forth. What I am absolutely certain of >>though, is that if you used a preprocessor that allowed infix, procedures >>with parameter lists, type checking, and all the other things that the >>rest of the Comp Sco world has agreed to be benificial, then the job would >>be much easier. > >NO, it would not. It is possible to write awful code for any language (ever >*looked* at the Unix source?). But even the best written C still looks, >well, sloppy. This is certainly your opinion. I personally don't really like C, but I have seen some "neat" code in C. But how about languages like Pascal or Modula-2? Is it any wonder why many beginning cs courses use Pascal? It's readable, that's why! > Forth lets you (but does not force you to) write very high level >code, which will converge to RPN english (noun verb format). Writing in this >style takes a bit more effort, but with proper factoring, and keeping most of >the Forth "noise" words down at a lower level, the resulting code is quite >readable, and does not suffer (at least at the top level), from "flip flop >swap drop" fever (although these "noise words are used at lower levels). >It is impossible to work to that high a level in languages like C, because the >language format is inflexible, and you cannot abstract out the ()s or other >pieces of syntactical noise from your code. For an even better place for this type of factoring, consider Smalltalk. It has an even better "noun verb" format - instead of "noun noun noun verb", it is "noun adjective noun verb noun" (anArray at: 5 put: 10) - and this I wouldn't consider to be RPN english! >As to the great infix/postfix/prefix/fix-the-fight controversy: > >RPN is not hard to learn, and quickly becomes intuitive. As to the assertion >that programmers don't learn it, how many are using HP Calculators? How many >non-programmers use adding-machines? OK, now this is where I draw the line. I use and HP calculator. Many of my friends use HP calculators. But, consider how HP calculators are used - you sit down, you type the numbers & the operators and you get the result. What you are doing is "writing" code. You are not reading it. RPN is easy to write. Yes, it is intuitive to write. But not to read. You have to learn to do that. And many times it take a lot of work. As a disclaimer, I want it noted that I like the basic idea behind forth. It is elegent. And there are some neat things you can do with it. And it is small. I like forth since I first learned about it in 82? when Byte did an issue on it. I just don't like the syntax WITH REGARDS TO ARITHMETIC EXRESSION (I have no problems with the RPN of procedure calls, although control statements are a minor hassle - this is something you can get use to). Oh, BTW, the "infix" system posted earlier actually works as a prefix system, and it looks better that way too. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= = "When I was young, all I wanted was to be | - gandreas@ub.d.umn.edu - = = ruler of the universe. Now that isn't | Glenn Andreas = = enough" - Alex P. Keaton | = =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=