<div dir="ltr"><div class="gmail_default" style="font-size:large">Pre pre-initialization, I do it as a compile option:<br><br><br><span style="font-family:monospace,monospace">Modern Pascal v2.0.0 (LINUX,CPU64,X86_64,LITTLEENDIAN,1180323)<br> Copyright (c) 2000..2017 by Ozz Nixon (Modern Pascal Solutions, LLC).<br><span style="font-family:monospace,monospace"> ■ Produces Cross-Platform 32bit/64bit Encrypted Binaries.<br></span><br>/usr/bin/mp2 [options] sourcefile [modifiers]<br>options:<br> -2 <span style="font-family:monospace,monospace">286 instructions</span> <span style="font-family:monospace,monospace">-3 <span style="font-family:monospace,monospace">386 instructions</span></span><br> <span style="font-family:monospace,monospace">-6 64bit<span style="font-family:monospace,monospace"> instructions -o objfpc compatible</span></span><br> -g compile to binary -t syntax check only<br><span style="font-family:monospace,monospace"> -p[0|1|2] Pack EXE -r<path> Resource dirs<br></span> -v version display -q syntax & method check<br> -? this screen -h history log<br><br>modifiers: (all are on by default)<br> -a- $A- Assert Support Off -m- $M- Auto-Initialization Off<br> -b- $B- Boolean Short Circuit Off -o- $O- Overflow Checking Off<br> -c- $C- New C Operators Off -p- $P- Auto-Properties Off<br> -d- $D- Full Disposal Off -r- $R- Range Protection Off<br> -f- $F- Autoinvoke Functions Off -s- $S- Enums Scoped Off<br> -h- $H- Hint of unused variables Off -x- $X- Extended Syntax Off<br> -j- $J- Constant Address Off -z- $Z- Case supports CONTINUE Off<br> -l- $L- Lazy Semicolon Off <br><br><br></span></div><div class="gmail_default" style="font-size:large"><span style="font-family:arial,helvetica,sans-serif"></span>All numeric values are 0, 0.0, Booleans 0 aka False, Strings = '' (blank), PChar and Pointers = Nil. * Now my product is to accent FPC not replace it in anyway. I use a separate code base, and use FPC to compile my compiler. My binaries are like .java or .Net managed binaries. I only have just over 1,000 end-users and we try to stick 100% compatible to Turbo Pascal 7, but support Delphi-isms and FPC-isms. It only takes a couple extra lines in asm to $M+ in my compiler (It has saved many customers who just assumed, I said "var a:longint" then a:=a+some_value (actually true PascalDevs never do that, it is my migrated clients who seem to insist on a+=some_value and then wonder why a!=some_value). So, I made MPC default to $M+.<br><br></div><div class="gmail_default" style="font-size:large">For FPC, I would default to true Pascal, A is an address, you get whats there unless you initialize it, and most code I see, except for loops, A is never being assigned 0 its is always being assigned a value from input_source. So save the few uSec and don't pre-init.<br><br></div><div class="gmail_default" style="font-size:large">My 2 cents from the script world...<br></div><div class="gmail_default" style="font-size:large">O.<br></div></div><br><br><div class="gmail_quote"><div dir="ltr">On Sun, Mar 25, 2018 at 2:38 AM Alexander Grotewohl <<a href="mailto:alex@dcclost.com">alex@dcclost.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It sounds more like you're making a case for all integers to be<br>
initialized to zero by default. I still fail to see any practical uses<br>
other than wanting to not type "integer" twice.<br>
<br>
Alex<br>
<br>
<br>
On 03/24/2018 11:20 AM, Ondrej Pokorny wrote:<br>
> On 24.03.2018 15:46, Alexander Grotewohl wrote:<br>
>> The patch is to put them on separate lines. Preferably with<br>
>> meaningful comments for each. If FPC was changed at the whim of every<br>
>> programmer we'd end up with a huge mess that no longer resembles pascal.<br>
><br>
> Please tell me who decides about the borderline between whim and<br>
> usefulness.<br>
><br>
> E.g. FPC supports initializing local variables, which Delphi and (if I<br>
> am not mistaken) ISO Pascal don't support:<br>
><br>
> procedure Test;<br>
> var<br>
> A: Integer = 0;<br>
> begin<br>
> end;<br>
><br>
> Is it a whim as well? If FPC has this extension, why not to support<br>
><br>
> procedure Test;<br>
> var<br>
> A, B: Integer = 0;<br>
> begin<br>
> end;<br>
><br>
> ?<br>
><br>
> Ondrej<br>
> _______________________________________________<br>
> fpc-devel maillist - <a href="mailto:fpc-devel@lists.freepascal.org" target="_blank">fpc-devel@lists.freepascal.org</a><br>
> <a href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel" rel="noreferrer" target="_blank">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel</a><br>
<br>
_______________________________________________<br>
fpc-devel maillist - <a href="mailto:fpc-devel@lists.freepascal.org" target="_blank">fpc-devel@lists.freepascal.org</a><br>
<a href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel" rel="noreferrer" target="_blank">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel</a><br>
</blockquote></div>