<div dir="ltr"><div class="gmail_default" style="font-size:large">As an extension, it makes sense - but I would make it a forced command line switch and obscure $modeswitch. So the code can easily be ported to other pascal compilers, or versions of FPC down the road. I spend 8 to 12 hours a day porting Delphi (versions) of code to FPC. And the XE series really made a mess of the language. I spend hours in FPC's core code, as I am making my script engine compatible with FPC's code (to be the interpreter for FPC source)...<br><br></div><div class="gmail_default" style="font-size:large">I agree, especially from a script world, I would expect to see:<br></div><div class="gmail_default" style="font-size:large">var a,b,c,d,e:String='';<br><br></div><div class="gmail_default" style="font-size:large">as it looks like a script engines extension to:<br></div><div class="gmail_default" style="font-size:large">const a,b,c,d:String='';<br><br></div><div class="gmail_default" style="font-size:large">// and in Delphi $J+ aka {$WRITEABLECONST ON} making constant read/write - you have basically produced what you are asking for. So, maybe FPC already supports this?<br><br></div><div class="gmail_default" style="font-size:large">* Now side note, you can define variable types in JavaScript (wrote my own ECMA compliant script engine in 2000 (DXJavaScript) for Delphi):<br></div><div class="gmail_default" style="font-size:large">var x = new Number(0);<br></div><div class="gmail_default" style="font-size:large">var y = new String("Hello World!");<br><br></div><div class="gmail_default" style="font-size:large">Of course, x and y are JavaScript objects at their core - so they can be any type later in the code. But, JavaScript does support type definition in the code. Number==Float==Integer.<br><br></div><div class="gmail_default" style="font-size:large">Ozz <br></div></div><br><br><div class="gmail_quote"><div dir="ltr">On Sat, Mar 24, 2018 at 1:13 PM Ondrej Pokorny <<a href="mailto:lazarus@kluug.net">lazarus@kluug.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 24.03.2018 16:51, Florian Klaempfl wrote:<br>
> Am 24.03.2018 um 11:46 schrieb Ondrej Pokorny:<br>
>> Is there a reason why multiple variable initialization is forbidden?<br>
>><br>
>> program Test;<br>
>> var<br>
>> A: Integer = 0; // allowed<br>
>> B, C: Integer = 0; // not allowed<br>
>> begin<br>
>> end.<br>
>><br>
>> Will a patch be applied that allows it?<br>
> As the first one is supported, I see no logical reason the second<br>
> shouldn't be supported, of course assigning 0 to B and C.<br>
<br>
Good to know there's somebody with the same point-of-view. Thanks :)<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>
</blockquote></div>