<div dir="ltr">Thanks Michalis for your excellent work! It's very important to left the early 90s associated with Pascal programming behind us and to encourage new developers to have a look onto the modern aspects of Object Pascal!<div><br></div><div>Maybe a little bit offtopic, but I have a question regarding the compiler directives: is there a way to tell Lazarus to use these directives in every new unit?</div><div><br></div><div>Best regards,</div><div>Marc</div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-06-21 7:47 GMT+02:00 Michalis Kamburelis <span dir="ltr"><<a href="mailto:michalis.kambi@gmail.com" target="_blank">michalis.kambi@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">2016-06-20 5:31 GMT+02:00 Mr Bee <<a href="mailto:pak.lebah@yahoo.com">pak.lebah@yahoo.com</a>>:<br>
[...]<br>
<span class="">> I have a little suggestion though. I prefer to use {$J-} directive in my<br>
> Pascal program. I think it encourages good programming practice in Pascal.<br>
> The {$J-} means constant is a constant no matter how you declare it. To bad<br>
> FPC is still using {$J+} as the default even in the {$MODE OBJFPC}, which<br>
> means a constant becomes a variable once you include the data type<br>
> eventhough it's declared within a 'const' block. CMIIW.<br>
><br>
<br>
</span>Ouch. For some reason, I thought that {$J-} is the default in {$mode<br>
objfpc} since years, and we have left that mistake behind us. Quick<br>
test showed me that I was mistaken. This makes a *lot* of my code less<br>
safe that I assumed, as in many recent projects I didn't bother to<br>
explicitly use {$J-}.<br>
<br>
This is an excellent suggestion then, thank you. I updated the<br>
document to encourage everywhere doing<br>
<br>
{$mode objfpc}{$H+}{$J-}<br>
<br>
at the beginning.<br>
<br>
I definitely *do not want* to explain to any new programmer what a<br>
"writeable constant" is... This concept should remain buried:)<br>
<div class="HOEnZb"><div class="h5"><br>
Regards,<br>
Michalis<br>
_______________________________________________<br>
fpc-pascal maillist - <a href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a><br>
<a href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal" rel="noreferrer" target="_blank">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal</a><br>
</div></div></blockquote></div><br></div>