[fpc-pascal]Delphi "9" language features...

Olle Raab olle.r at automagika.se
Wed Aug 11 21:53:03 CEST 2004

04-08-11 21.08, skrev Michael.VanCanneyt at Wisa.be följande:
> But the IEnumerated interface part is really over the top. It requires the
> compiler to have 'knowledge' of certain complex types, which is a bad
> thing and totally arbitrary.

> The last time they did that was with Variants, which has been a dirty
> mess every since. It destroys the beauty and strict typing of Object
> Pascal...

Isn't this the same with exception handling, which requires knowledge of
Exception class.

Also, here is a forwarding of a question I asked on their discussion forum:


Is the iteration order guarantied, or is it undefined ?

In the latter case it allows the compiler to choose an optimized order, or
to use several threads.
Olle Raab [@] , 11.08.2004, 11:02am [link] [hide]


Olle: The iteration order when using IEnumerable interfaces is defined by
the implementor of the interface, not by the language syntax. It is quite
possible that the IEnumerable implementor may order or filter the returned

For data patterns, the for..in loop is equivalent to for x := Low(range) to
High(Range) do. Note that loop induction optimizations may cause the
generated machine code to use some other index representation, including
eliminating the index entirely (increment pointer instead of index into
array) or inverting the range (high to low, normalize by subtraction) but
that the visible artifact is always low to high.

We have discussed unordered enumerators, specifically in the context of
distributing serial loop iterations across multiple threads. This will only
be done through a syntax extension that changes the language definition to
allow out of order enumeration in that specific syntax.
Danny Thorpe , 11.08.2004, 11:13am [link] [hide]


More information about the fpc-pascal mailing list