Am 25.06.2019 um 06:20 schrieb Marģers . via fpc-devel:
----- Reply to message -----
Subject: Re: [fpc-devel] XML node dump feature
Date: otrd., 25 jūn., 03:16
From:  Ben Grasset <operato...@gmail.com>
To:  FPC developers' list
<fpc-devel@lists.freepascal.org>

const
   A: TVec3F = (X: 1.2; Y: 2.4; Z: 3.8);
   B: TVec3F = (X: 2.1; Y: 4.2; Z: 8.3);
   // You can't do the next part currently, obviously
   C: TVec3F = A + B;
   D: TVec3F = A - B;
   E: TVec3F = A * B;
   F: TVec3F = A / B;

Sorry to say but, this should not work even with
*pure* function.  Typed constants are not truly
constants.
Correct. Though considering that we're talking about *compile time* the compiler *could* treat consts (in {$J-} mode) as constants if pure functions are involved... Though it would need a bit more work as currently the compiler is "simply" piping the constant values of typed constants into the output assembly.

Regards,
Sven
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to