Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!julius.cs.uiuc.edu!zaphod.mps.ohio-state.edu!unix.cis.pitt.edu!pitt!willett!ForthNet From: ForthNet@willett.pgh.pa.us (ForthNet articles from GEnie) Newsgroups: comp.lang.forth Subject: ANS FORTH TECHNICAL COMMITTEE Message-ID: <2300.UUL1.3#5129@willett.pgh.pa.us> Date: 4 Feb 91 12:35:31 GMT Organization: (n.) to be organized. But that's not important right now. Lines: 87 Category 10, Topic 2 Message 307 Sat Feb 02, 1991 F.SERGEANT [Frank] at 18:03 CST Elizabeth Rather wrote: >I'd really like to see a "show of hands" ... ... >Once again, stand up and be counted: how do you vote? ... >OK, FOLKS, PUT UP OR SHUT UP. I HAVE LISTED SOME ISSUES THAT ARE >OPEN FOR DISCUSSION AT THE NEXT MEETING AND I PERSONALLY PLEDGE TO >REPRESENT MAJORITY VOTES ON THE ABOVE ISSUES. TAKE A POSITION AND >TELL ME WHAT YOU THINK AND WHY! . I replied to it with some comments (because, naturally, it pleased me to do so). I was willing to state my opinion (my "vote"). I did not necessarily go into detail as to the WHY. I was not attempting to convert others to my views, merely to state what my views were -- more or less in answer to Elizabeth's request. . Then Jan Stout commented on some of my comments. . JS>How can you expect people to go along with your ... . I really don't expect them to. . JS>How can you expect people to go along with your ( row col -- ) JS>proposal if you don't give some example of the benefits of this JS>factoring. . Mainly, I was just saying that I use and prefer ( row col -) to ( col row -). I am not saying anyone else needs to prefer it. I think my primary reason is it is easier for me to visualize going down and then across that to visualize going across and then down. What with + to modify one and +UNDER to modify the other and the possibility of AT being a CODE definition, I don't see machine efficiency as the overwhelming criterion for the order of the arguments. Elizabeth & PolyForth probably prefer ( row col -) for "better" reasons than I offer. I'd like to hear them. Meanwhile she's got one more "vote" for her preferred method. I often do something like STARTING-POINT 2@ ( y x) dX + AT but how can I really object to STARTING- POINT 2@ ( x y) dX +UNDER AT ? And, while I said what I used & preferred, I also suggested it be omitted from the standard all together. . . JS>Again I don't understand your enthousiasm for FOR/NEXT over JS>DO/LOOP. . Well, I don't understand it either. FOR/NEXT just resonated with me somehow. I liked it from the start and never use DO/LOOP. I don't even keep DO/LOOP loaded in my system. As I mentioned, I don't object to others using it. And, with the proposed standard allowing its requirement of DO/LOOP to be met merely by including the source code for it, I'm looking upon the proposed standard more favorably than I used to. . Furthermore, you offer efficiency arguments with the examples . : TYPE SWAP OVER + ?DO I C@ EMIT LOOP ; instead of : TYPE FOR C@+ EMIT NEXT ; with : C@+ 1+ DUP 1- C@ ; . might I offer clarity, simplicity, readability arguments in favor of FOR/NEXT? In addition there are the many loops that do not need access to the index. FOR/NEXT's index is down counting. In many situations its index I can be used as conveniently as FOR/NEXT's I. And, since implementations vary, I don't see that it is clear that DO/LOOP is more efficient even in those cases that do use the upcounting index. Depending on the implementation, it may be that either computing the index is less efficient or that testing the loop termination condition is less efficient (or both) than using FOR/NEXT either with or without its index. I believe that Robert Berkey has offered implementation examples of both FOR/NEXT and DO/LOOP in terms of the other. All in all I am of the opinion that neither can be declared the "best" loop based only in terms of efficiency of its implementation. All I know is I like FOR/NEXT and find it much more pleasing than DO/LOOP. I think it is because it is simpler to use. I use it (as I think I've mentioned) with the loop done u times rather than u+1 times. I have even been speculating lately whether I should convert to an *up- counting* index in FOR/NEXT. One of the arguments in favor of FOR/NEXT has been its simplicity of keeping only one item on the return stack and the ease of testing it for loop termination (). I would give that up to get my up-counting index. I have come to no conclusion yet about this. . -- Frank ---- continued ---- ----- This message came from GEnie via willett. You cannot Reply to the author using email. Please post a follow-up article, or use any instructions the author may have included (USMail addresses, telephone #, whatever). Report problems to: dwp@willett.pgh.pa.us or uunet!willett!dwp