[fpc-devel] Re: Testing for..in feature
ip at kmiac.ru
Thu Nov 5 05:39:17 CET 2009
Alexander Klenin wrote:
>> 2) skip any compiler code modifications since the next code still works and
>> outputs 5 numbers:
>> type T = (a1, b1=5);
>> ch: T;
>> for ch in T do
>> WriteLn(Ord(ch)); // <- note Ord() here
> What are these numbers? (Sorry, I am at work, can not test from here).
> I would be surprised if they are "0 5".
0, 1, 2, 3, 4, 5
>> 4) write 2 magic functions: one to get the next enum value, one to get the
>> previos enum value and implement a special handling in the for-in loop for
>> such arrays
> I always thought Succ/Pred are exactly such magic functions ;-)
yes, forgot about them.
More information about the fpc-devel