<html><head></head><body><div class="ydp5a89663yahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;"><div><div dir="ltr" data-setdir="false">Writable constant indeed doesn’t make any sense, either in semantic or scoped variable. That’s why I prefer to disable it by default. Even Delphi had it disabled since Delphi 3, if my memory serves me right. However, this topic had been discussed over and over since a decade ago in FPC list but nothing changes. FPC still enables it by default both in Delphi and FPC mode.</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false"><br></div><div class="ydp5a89663signature"><div style="font-family:Helvetica, Arial, sans-serif;font-size:16px;">–Mr Bee<div><br></div></div></div></div>
<div><br></div><div><br></div>
</div><div id="ydp930c8399yahoo_quoted_0930430657" class="ydp930c8399yahoo_quoted">
<div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
<div>
Pada Sabtu, 1 Februari 2020 19.30.38 WIB, Michael Van Canneyt <michael@freepascal.org> menulis:
</div>
<div><br></div>
<div><br></div>
<div><div dir="ltr"><br clear="none"><br clear="none">On Sat, 1 Feb 2020, Sven Barth via Pas2js wrote:<br clear="none"><br clear="none">> Am 01.02.2020 um 09:33 schrieb Michael Van Canneyt:<br clear="none">>> If 20 years after the demise of Turbo Pascal we cannot expect people <br clear="none">>> to change a couple of consts into a var, then all hope for humanity <br clear="none">>> (well, at least the pascal programming community) is simply lost.<br clear="none">>><br clear="none">>> FPC was created when TP still existed. It made sense to allow writable<br clear="none">>> const for easy porting. Same for Delphi. But IMHO not in a new tool 25 <br clear="none">>> years after the facts.<br clear="none">><br clear="none">> The main use of writable consts that you can only cover with OOP <br clear="none">> otherwise is static, scoped variables. I personally agree that global <br clear="none">> constants should be declared as readonly, but for local ones there might <br clear="none">> be a use for it even if you or I don't necessarily consider it a good one.<br clear="none"><br clear="none">Indeed, I don't see the point of static scoped variables. <br clear="none">But if you need those, then I'd rather see<br clear="none"><br clear="none">var a : integer; static;<br clear="none"><br clear="none">or something similar, than<br clear="none"><br clear="none">const<br clear="none"> a : Integer= 0;<br clear="none"><br clear="none">Const should be exactly that, a const. My guess is that the original<br clear="none">"writable const" was simply a bug declared a feature.<div class="ydp930c8399yqt4603682733" id="ydp930c8399yqtfd02159"><br clear="none"><br clear="none">Michael.<br clear="none">_______________________________________________<br clear="none">Pas2js maillist - <a shape="rect" href="mailto:Pas2js@lists.freepascal.org" rel="nofollow" target="_blank">Pas2js@lists.freepascal.org</a><br clear="none"><a shape="rect" href="https://lists.freepascal.org/cgi-bin/mailman/listinfo/pas2js" rel="nofollow" target="_blank">https://lists.freepascal.org/cgi-bin/mailman/listinfo/pas2js</a><br clear="none"></div></div></div>
</div>
</div></body></html>