[fpc-devel] Limitations of static "ranged" integer typesandsucc/pred, and dynamic solution.

Marco van de Voort marcov at stack.nl
Sat Dec 24 18:36:28 CET 2011


In our previous episode, Skybuck Flying said:
> "
> You are totally right. Please submit a patch for conforming arrays support
> :-)
> "
> 
> Glad you agree, now we can discuss possible solutions ;) :)
> 
> First a solution has to be found, possible solutions could be:
> 
> TRangedInteger = record
>     Low : integer;
>     High : integer;
>     Value : integer;
> end;
> 
> or perhaps just a range or perhaps both.
> 
> TRange = record
>     Low : integer;
>     High : integer;
> end;

See the ISO spec for conforming arrays. Arrays are all the same type, so you
only have to the range once per array. Afaik they are passed as pseudo
parameters though, not with structures.

> So you see coming up with a solution wasn't that hard, however this is still 
> a somewhat half-baked solution.

Exactly, and why bother so much if a complete ISO committee has already
specified it for you?  
 
It has been on the wish list of (at least some of) the FPC team for a long
time to implement this, all was lacking was somebody with the interest in
making it happen.

I'm very glad you finally decided to do something about it!




More information about the fpc-devel mailing list