Talk:for-in loop

From Free Pascal wiki
Revision as of 17:43, 12 September 2011 by Nashev (talk | contribs) (Proposed extensions - Select which enumerator to use)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Proposed extensions - Select which enumerator to use

Why so complicated syntax and new keyword using? Why do not just always use syntax like for x in <IEnumeratorExpression> do ...;, as described in Variant3 and Variant4? In this case no need to introduce any FPC-specific operator (or just to describe default enumerator, to make text shorter?..), no need 'enumerator MoveNext' and 'enumerator Current' modifiers, because interface implementation already can be mapped to other methods... --Nashev 18:43, 12 September 2011 (CEST)

Proposed extensions - index

May be more pretty will python or php-like syntax for ch[i] in s do Writeln(i, ': ', ch); (see for reference) --Nashev 18:43, 12 September 2011 (CEST)