RE: Why 'for', not 'from' ?
- Posted by Al Getz <Xaxo at aol.com> Jun 02, 2003
- 389 views
Igor Kachan wrote: > > > Dear EU users: > > There is well known "for loop" in most of > programming languages. > > But why it is "for", not "from" ? > > Say, the below construction seems to be much > more clear than standard one : > > from i=1 to 100 do > ---- > end from > > > for i=1 to 100 do > ---- > end for > > Or, maybe, that programmer was not the > English programmer, but a great Mumbo-Jumbo one ? > > Or, maybe, my Muller's dictionary is not so good > about the main words ? > > Regards, > Igor Kachan > kinz at peterlink.ru > > Hello there Igor, for x=1 to 10 do end for The range starts at 1, not at x. x takes on the values 1 though 10, so "from x=1 to 10 do" isnt correct, because nothing starts "from" x. Even though something does in fact start at "1", x only takes on that value one time, not as a constant. The phrase "for x=1 to 10" declares that something called x will take on a range of values, not just one alone, and we arent starting 'from' or 'at' a RANGE of values, just ONE single value. the part of the phrase "from x=1 to 10" "from x" implies that there exists something "at x" from which to start, which there really doesnt. and nothing starts 'at x', it starts 'at 1' or, 'from 1'. In particular, x starts at 1, not at x. x doesnt start from x, it starts from 1. Rewording that part of it, "from x" (=1 to 10 do) would look like this: "starting at x" (=1 to 10 do) and the whole thing would look like this: "starting at x=1 to 10 do" which is totally incorrect because nothing is starting at x, x is starting at 1. Any doubts? BTW, do you play chess as good as Kasparov? Take care for now, Al