1. Why 'for', not 'from' ?
- Posted by Igor Kachan <kinz at peterlink.ru> Jun 02, 2003
- 404 views
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
2. Re: Why 'for', not 'from' ?
- Posted by euman at bellsouth.net Jun 02, 2003
- 391 views
On 2 Jun 2003 at 20:06, 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 for i = x to y do from i = x to y do (for) looks better to me cause ( i ) is where we obtain the variable in the range of x to y Euman
3. Re: Why 'for', not 'from' ?
- Posted by Greg Haberek <g.haberek at comcast.net> Jun 02, 2003
- 386 views
it means "for every value of i from 1 to 100 [by x]"
4. Re: Why 'for', not 'from' ?
- Posted by "Carl W." <euphoria at cyreksoft.yorks.com> Jun 02, 2003
- 412 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" ? The english sentence that replaces the programming language statement: for N = Start to End do is: For every 'N' from Start to End, do what follows. Notice that the computer language follows as closely as possible the syntax of english. Wording it to put 'From' at the beginning we would end up with: From Start to End, putting the value in 'N', do what follows. and hence (perhaps): from Start to End into N do Putting the variable (N) after a 'from' wouldn't scan properly. Perhaps a 'with each' statement would be a better (hypothetical) choice?: with each N from Start to End do Carl -- [ Carl R White == aka () = The Domain of Cyrek = ] [ Cyrek the Illogical /\ www.cyreksoft.yorks.com ]
5. Re: Why 'for', not 'from' ?
- Posted by Igor Kachan <kinz at peterlink.ru> Jun 02, 2003
- 409 views
Hello Euman: > > Say, the below construction seems to be much > > more clear than standard one : > > > > from i=1 to 100 do > > ---- > > end from > > > > for > i = x to y > do > > from > i = x to y > do > > (for) looks better to me cause ( i ) is > where we obtain the variable in the range > of x to y OK, your explanation is clear and good, indeed. But (from) doesn't require any explanation at all, see please once more: from i=1 to 100 do ---- end from Just take a dictionary and see "from", "to", "do", "end". My question is the base for the loadable key words in EU. If we are going to get some perfect thing from the current one, this thing must be first of all flexible, so to say, pliant for the corrections. Take a look at the EU source - there are just tables with the key words and the built-in routines. EU is very pliant inside for the key words transformations. But inner codes must be stable, and they are stable. My question is not the question of a taste, but if EU is flexible, then you can make it just on your taste too. And inner codes and the tables' structure is that frame, which allows to translate from any local EU language into the RDS standard very easily. Same for the reverse translation. Regards, Igor Kachan kinz at peterlink.ru
6. Re: Why 'for', not 'from' ?
- Posted by Pete Lomax <petelomax at blueyonder.co.uk> Jun 02, 2003
- 402 views
On Mon, 2 Jun 2003 21:39:32 +0400, Igor Kachan <kinz at peterlink.ru> wrote: >My question is the base for the loadable key words in EU. If you want to do this, it really ought to be done at the editor level, rather than as a fundamental change to the actual keywords stored in the source file. That way you can load code written by someone else with english keywords and the editor will display the russian (or whatever) equivalents, and you can write code using the russian keywords but I'd see the english versions. In MEditor, the keywords are stored as single byte values, eg "while" is held internally during the edit as 10, but obviously converted back before display/print/save. If you are interested in this approach have a look at keywords.e and the use in analyse.e. Pete
7. Re: Why 'for', not 'from' ?
- Posted by Igor Kachan <kinz at peterlink.ru> Jun 02, 2003
- 393 views
Hello Al, > 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 ? > > 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. Al, my loop starts "at i=1" and ends "at i=100", so "from i=1" is ok, but "for x" doesn't work. No? Try please yours code: for x to 100 do end for under EU control. [sorry, snipped just repetitions] > Any doubts? No, never, bad decision is better than doubts > BTW, do you play chess as good as Kasparov? I never play chess at all, BTW, so match("Kasparov","Kachan") is just impossible on definition I play FreeCell and with my Tamara cat. > Take care for now, > Al Good luck with "for x" Thanks Carl, Thanks Greg! Best Regards, Igor Kachan kinz at peterlink.ru
8. Re: Why 'for', not 'from' ?
- Posted by Igor Kachan <kinz at peterlink.ru> Jun 02, 2003
- 389 views
Hello Pete: > On Mon, 2 Jun 2003 21:39:32 +0400, Igor Kachan <kinz at peterlink.ru> > wrote: > >>My question is the base for the loadable key words in EU. > If you want to do this, it really ought to be done at the editor > level, rather than as a fundamental change to the actual keywords > stored in the source file. That way you can load code written by > someone else with english keywords and the editor will display the > russian (or whatever) equivalents, and you can write code using the > russian keywords but I'd see the english versions. > > In MEditor, the keywords are stored as single byte values, eg "while" > is held internally during the edit as 10, but obviously converted back > before display/print/save. If you are interested in this approach > have a look at keywords.e and the use in analyse.e. Thanks Pete, I didn't see your editor now, but early version was seeming without foreign languages support. Then, there are 3 different Russian encodings for EU - DOS Russian, WIN Russian and NIX Russian. Then, to understand other Russian names, not only key words and built-in routines, interpreters must have the unlimited alphabet -- 128 -- 255 chars for names. I have such interpreters just now, but they have no translators to C, binding and other RDS's heavy armament. So, I ask Rob for these features. And these features are useful, I am sure now. I have thanks from my users just for translated EU docs and for unlimited alphabet. Regards, Igor Kachan kinz at peterlink.ru
9. Re: Why 'for', not 'from' ?
- Posted by Igor Kachan <kinz at peterlink.ru> Jun 03, 2003
- 386 views
Hello Al: > --compare: > > for our container that is going to hold 1 to 10 different objects > --sounds ok > > from our container that is going to hold 1 to 10 different objects > --sounds like we are going to take something out of it. Why out? See please: A--------------------B A is start point of the loop's parameter. B is finish point of the loop's parameter. Parameter goes "from the A point to the B point". Is "out A to B" good in English for the line above ??? [snip] > Then again, the 'for' loop takes up two less > bytes per loop > instance; what do you have to say about that? Any key word inside EU interpreter is just 1 byte. In Russian, "FROM" = "OT" or "IZ", "OUT" = "IZ", but "FOR" = "DLYA" Regards, Igor Kachan kinz at peterlink.ru
10. Re: Why 'for', not 'from' ?
- Posted by dm31 at uow.edu.au Jun 03, 2003
- 390 views
Because the for loop has the parameter first, then the range, it is grammatically incorrect to have it from x=1 to 10. for x=1 to 10 is a shortened form of 'for x in the range of 1 to 10'. Most of this comes from how we talk about variables in mathematics. if the parameter 'x' (or whatever you choose) was not before the range (ie, the syntax was more like from 1 to 10 ... with parameter after) then from would be grammatically correct as we would have the 'from' refering to the start of the range, not the WHOLE range(the parameter). Hope that makes sense for you. Cheers, Dan. On Tue, 3 Jun 2003, Igor Kachan wrote: > > > Hello Al: > > > --compare: > > > > for our container that is going to hold 1 to 10 different objects > > --sounds ok > > > > from our container that is going to hold 1 to 10 different objects > > --sounds like we are going to take something out of it. > > Why out? > > See please: > > A--------------------B > > A is start point of the loop's parameter. > B is finish point of the loop's parameter. > > Parameter goes "from the A point to the B point". > Is "out A to B" good in English for the line above ??? > > [snip] > > > Then again, the 'for' loop takes up two less > > bytes per loop > > instance; what do you have to say about that? > > Any key word inside EU interpreter is just 1 byte. > In Russian, "FROM" = "OT" or "IZ", "OUT" = "IZ", > but "FOR" = "DLYA" > > Regards, > Igor Kachan > kinz at peterlink.ru > > > > TOPICA - Start your own email discussion group. FREE! > >
11. Re: Why 'for', not 'from' ?
- Posted by Derek Parnell <ddparnell at bigpond.com> Jun 03, 2003
- 393 views
In the English language, the word 'from' can be used to indicate the 'source' of some thing, or a starting point (particularly in a travel context). A famous phrase is "From here to eternity". To use 'from' in the context of a auto-increment loop construct, you might get away with ... with x FROM 1 to 10 do . . . end with But to place 'from' at the start of a phrase in English, indicates that you are trying to identify the source of something. So ... from x = 1 to 10 do . . . end from Sounds to an English speaker as if you are getting something out of 'x' or maybe start with x. You might be able to convince that person that you mean "from the set of numbers, 1 to 10, ..." but that is pushing it a bit. -- cheers, Derek Parnell
12. Re: Why 'for', not 'from' ?
- Posted by Igor Kachan <kinz at peterlink.ru> Jun 03, 2003
- 409 views
Hello Dan, Henry, Derek : Thanks for your hard work! But I have the last questions on this subject. _____ | | -----> is it "from"? Yes it is. Isn't it? |_____ "iz" in Russian | | | | |____| ----> is it "from"? Yes it is. Isn't it? "ot" in Russian A--->---B is it "From A to (into) B"? Yes it is. Isn't it? "ot A do B" (for the points) or "iz A v B" (for the towns) in Russian 1,2,3,4,5 is it "From 1 to 5"? Yes it is. Isn't it? "ot 1 do 5" in Russian x=1,2,3,4,5 is it "From x=1 to x=5"? Yes it is. Isn't it? "ot x=1 do x=5" in Russian Where is that "FOR" for ("dlya" in Russian) the loop's parameter? How can I say "From 1 to 5" another way in English? Thanks, Regards, Igor Kachan kinz at peterlink.ru
13. Re: Why 'for', not 'from' ?
- Posted by Derek Parnell <ddparnell at bigpond.com> Jun 03, 2003
- 401 views
----- Original Message ----- From: "Igor Kachan" <kinz at peterlink.ru> To: "EUforum" <EUforum at topica.com> Subject: Re: Why 'for', not 'from' ? > > > Hello Dan, Henry, Derek : > > Thanks for your hard work! > > But I have the last questions on this subject. > _____ > | > | -----> is it "from"? Yes it is. Isn't it? > |_____ > > "iz" in Russian > > | | > | | > |____| ----> is it "from"? Yes it is. Isn't it? > > "ot" in Russian > > A--->---B is it "From A to (into) B"? Yes it is. Isn't it? > "ot A do B" (for the points) > or "iz A v B" (for the towns) in Russian > > 1,2,3,4,5 is it "From 1 to 5"? Yes it is. Isn't it? > "ot 1 do 5" in Russian > > x=1,2,3,4,5 is it "From x=1 to x=5"? Yes it is. Isn't it? > "ot x=1 do x=5" in Russian > > Where is that "FOR" for ("dlya" in Russian) the loop's parameter? I have almost NO idea what you are talking about above. But are you trying to demonstrate that 'from' can mean a number of different things? That is not news. In English, most words have more than one meaning and we also have many words for the same thing. Sorry, but just have to cope with this. The Euphoria phrase "for x = 1 to 5 do" can be better expressed in English (and remember that Euphoria is not the English language) as "repeat for each number in the range 1 through 5; assign x the number and then do the following things...". > How can I say "From 1 to 5" another way in English? Try "Starting with 1 through to 5". -- Derek
14. Re: Why 'for', not 'from' ?
- Posted by Igor Kachan <kinz at peterlink.ru> Jun 03, 2003
- 382 views
Thanks Derek, Thanks Matt, Thanks Al: [snipped many very useful info for me, thanks] > > How can I say "From 1 to 5" another way in English? > > Try "Starting with 1 through to 5". Ok, this phrase is just about a variable, but seems to be too long. But where is that famous FOR? Yes, English is good, but I really prefer Russian for this subject: "ot 1 do 5" ili "ot x=2 do 100 po 2" - Russian "from 1 to 5" or "from x=2 to 100 by 2" - English "for x=2 to 100 by 2" - EU & Company English is not so good for the loops programming, just on my taste, sorry. EU for-loop is clear for me now Thanks again! Best Regards, Igor Kachan, kinz at peterlink.ru