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

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

Hi Igor.

If you really want to stick to the keyword (from) in a do-loop I would 
suggest the following syntax extension to Eu:

sequence S

for obj from S do
   ...
   <some statements involving obj>
   ...
   end for

which would be semantically equivalent to:

for i = 1 to length(S) do
   ...
   <some statements involving S[i]>
   ...
   end for

and would read "for obj taking all its values from S do the following".

This would give a shorthand notation that might improve the readibility. 
IMHO that control structure would not betray the spirit of Euphoria. But 
there is of course one BIG caveat: would a modification of the sequence of 
values be allowed inside the loop? Preferably not, but then, is it easy for 
the interpreter to check for such a situation?

Henri Goffin


-----Original Message-----
From:	Igor Kachan [SMTP:kinz at peterlink.ru]
Sent:	Monday, June 02, 2003 10:17 PM
To:	EUforum
Subject:	Re: Why 'for', not 'from' ?

 << File: ATT00082.txt; charset = KOI8-R >>

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

Search



Quick Links

User menu

Not signed in.

Misc Menu