Am 10.11.2018 um 12:17 schrieb Ryan Joseph:
> This also fails.
I personally find this case much more limiting.

Another implication is that you can't build up consts from other record consts,
such as:

------------------------------
type
        TMyRecord = record
                        a: integer;
                        b: string;
        end;
const
        TMyRecord_Default: TMyRecord = (a: 100; b: 'foo');
        TMyRecord_Another: TMyRecord = (a: 200; b: 'bar');

        SomeRecords: array[0..1] of TMyRecord = (
          TMyRecord_Default,
          TMyRecord_Another);
------------------------------
There is a pointer hack to get around that, but it would be really useful if
this worked out of the box.

And yes, I know this is because record consts are (writeable, at worst) typed
consts and as such are only preinitialized global variables, not true consts,
but it still bothers me...

-- 
Regards,
Martok


_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to