04-08-11 21.08, skrev [EMAIL PROTECTED] 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 [EMAIL PROTECTED] , 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 data. 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] ------------------------------------- _______________________________________________ fpc-pascal maillist - [EMAIL PROTECTED] http://lists.freepascal.org/mailman/listinfo/fpc-pascal