Re: Why 'for', not 'from' ?

new topic     » goto parent     » topic index » view thread      » older message » newer message

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 ]

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu