Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!zaphod.mps.ohio-state.edu!usc!ucsd!ucbvax!SCFVM.GSFC.NASA.GOV!ZMLEB From: ZMLEB@SCFVM.GSFC.NASA.GOV (Lee Brotzman) Newsgroups: comp.lang.forth Subject: Re: ANS TC Magnet for Division Message-ID: <9008011651.AA18383@ucbvax.Berkeley.EDU> Date: 1 Aug 90 16:45:01 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 109 John J Wavrik , writes: >Let's look at division. Here is the way in which the ordinary signed >division operation is obtained from UM/MOD (copied from F83): > > >R S>D R> ?DUP > IF DUP >R 2DUP XOR >R >R DABS R@ ABS UM/MOD > SWAP R> ?NEGATE > SWAP R> 0< IF NEGATE OVER IF 1- R@ ROT - SWAP THEN THEN > R> DROP > THEN SWAP DROP > >If everyone would use this sequence whenever division is required in >their application, all would be well. Reality check: the fact that not everyone will use this sequence is precisely the problem. There is no consensus on this particular issue. The standards process demands consensus. Therefore, this issue must be resolved through compromise (which, simply stated, is a means of "redistibuting unhappiness" so that it becomes bearable to all involved). The compromise reached on this issue was an artful one, and very simple to understand, unlike the problem it fixed. The arguments pro and con on floored division have been flying around for eight years and still there is controversy. Isn't that evidence enough that some kind of compromise was needed? >... We could glance at it and tell >immediately what kind of division is being used. But this will not >happen. Instead programmers will define / somewhere (probably in a >file which is automatically loaded into their system). They will use >the symbol / for division -- but it now will be a programmer-dependent >word. So what else is new? Before, one had to know that the code was Forth-79 or Forth-83 in order to correctly interpret / . I take that back: one could know the base standard being used and STILL not know how to interpret division because it was, and is, implemented differently in systems that otherwise comply with their standard. This is a product of the aforementioned ongoing controversy. Do you honestly believe that I would be unable to understand an algorithm because I couldn't be sure of whether floored or truncated division was used? It's simple, "the division operator, /, will work the way I define it in *my* system, not the original implementer's." And if that interpretation proves to be wrong, I preface the code with: : / FM/MOD NIP ; or : / SM/MOD NIP ; (if I got the stack right) whichever is the antonym of the way my system is implemented. This is a hell of a lot simpler than the mess we have now, to which there is no easy answer. If the implementer really cares about portability, he should use the explicit division routine of his choice rather than using / . I believe this is mentioned in Basis. If it isn't, it should be. The ANSI team did us a favor by making a complicated pain in the ass into a simple pain in the ass. I agree that it would be better to remove the pain altogether, but it just ain't gonna happen. > ... A compromise which makes >basic words programmer dependent increases the difficulty of >understanding application fragments. Just what other basic words are programmer dependant? And were they programmer/standard dependant before? And is the number of dependencies decreasing or increasing? Would any ANSI committee members care to give a quick synopsis? >It is a very bad idea to let the meaning of fundamental words float. >There should be absolute agreement on the meaning of the 100-150 words >needed to generate the Forth language. Agreed. Now if the standard were written by one person or one company that could happen. Tell you what, John, write a standards document that you feel is the best it can be -- take the Basis and fix what you perceive to be the flaws, for instance -- then try to get everyone to use it. Suppose you received several negative comments from people who would refuse to use Wavrik-90 Forth until the contentious parts of the Standard were modified. Would you seek a compromise? Remember that if you don't, then the standard will be crippled by the lack of universal acceptance. Think hard about this. Can there ever be a perfect standards document? >These statements are really not revolutionary. Both Shakespeare and >Hemmingway agree on the meaning of "the", "is", "be", etc. Their >contribution to writing does not consist in changing the meaning of >fundamental English words. Allowing everyone to choose their own >meaning for basic words can only have one effect: it will make it >harder to communicate. Another misguided analogy. Look in a dictionary. My copy of Webster's Collegiate lists four definitions for "the"; the first with 11 qualifications, the second with two qualifications, and the third with two, and the fourth with one. None of the definitions vary greatly, but they are slightly different and depend on the context that "the" is being used in. Seems to me that having only two precisely-defined alternatives for / isn't so bad, after all. Let's see, how about the word "then" as long as I have the dictionary open... "Then" can mean "at that time", "soon after that" , or "in that case" . Again, each meaning depends on the context in which the word is used. I wonder how we ever learned to communicate with such variation in meaning? > John J Wavrik > jjwavrik@ucsd.edu Dept of Math C-012 > Univ of Calif - San Diego > La Jolla, CA 92093 -- Lee Brotzman (FIGI-L Moderator) -- BITNET: ZMLEB@SCFVM Internet: zmleb@scfvm.gsfc.nasa.gov -- I'm only a contractor, don't blame me for the tax rates and don't blame -- the government for my statements.