Re: Info about the -Mdelphi mode
Martin Frb via fpc-pascal <[email protected]> Fri, 24 Apr 2026 10:12:59 +0200
| Newsgroups | gmane.comp.compilers.free-pascal.general,gmane.comp.compilers.free-pascal.social |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format. --===============4958342729995374496== Content-Type: multipart/alternative; boundary="------------MWK0qw4Caoockdh0y3q6fZl5" Content-Language: en-GB This is a multi-part message in MIME format. --------------MWK0qw4Caoockdh0y3q6fZl5 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit CC'ed to [email protected] => for follow ups On 23/04/2026 15:23, Graeme Geldenhuys via fpc-pascal wrote: > On Thursday, 23 April 2026 10:53:02 BST michael via fpc-pascal wrote: >> Other than that I have no knowledge of missing delphi things except >> inline variables. > I just just reading a article from a few years ago, explaining the pros and > cons of inline variables. It actually made a really good case for that. There > is a open MR for inline variables already - just not review/merged. > > https://blogs.embarcadero.com/introducing-inline-variables-in-the-delphi-language/ Apart from the general yes/no question.... (and I haven't looked deep into language design..., still...) If for arguments sake, it was a yes: 1) "begin/end" are compound statements, not scopes (even mentioned on the big forum thread) 2) If a "inline scope" existed, no mention of "inline var" only at the start thereof. 3) same keyword "var" but significant difference: block vs single statement (one var only) Currently (not tested), but from description if foo then begin writeln; var bar: integer = 1; // mid (implied) scope readln; end; So within the "for arguments sake", shouldn't it then be if foo then // optional introduction of new keyword to start scope var // "var" starts scope (and must be followed by "begin" bar: integer = 1; bar2: integer = 2; begin writeln; readln; end; - Without a "scope keyword" => "var" starts the new scope. That scope covers the next statement (which must be compound begin/end). - var block ends at begin (which starts the statement for which the scope will last) And the "for var i := is inconsistent. Its the only one that allows "var" mid-statement. (wel, its the only(?) LHS that can be mid statement...) > Any word on multi-line text blocks? ;-) Coming from Java, I so MISS that in > Object Pascal! :-D Aren't they in 3.3.1 already? And 2 forms? backtick and multi-single-quote? --------------MWK0qw4Caoockdh0y3q6fZl5 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body> <div class="moz-cite-prefix">CC'ed to <a class="moz-txt-link-abbreviated" href="mailto:[email protected]">[email protected]</a> => for follow ups<br> <br> On 23/04/2026 15:23, Graeme Geldenhuys via fpc-pascal wrote:<br> </div> <blockquote type="cite" cite="mid:8774722.NVGHFGmpDH@graeme-linux-desktop"> <pre wrap="" class="moz-quote-pre">On Thursday, 23 April 2026 10:53:02 BST michael via fpc-pascal wrote: </pre> <blockquote type="cite"> <pre wrap="" class="moz-quote-pre">Other than that I have no knowledge of missing delphi things except inline variables. </pre> </blockquote> <pre wrap="" class="moz-quote-pre"> I just just reading a article from a few years ago, explaining the pros and cons of inline variables. It actually made a really good case for that. There is a open MR for inline variables already - just not review/merged. <a class="moz-txt-link-freetext" href="https://blogs.embarcadero.com/introducing-inline-variables-in-the-delphi-language/">https://blogs.embarcadero.com/introducing-inline-variables-in-the-delphi-language/</a></pre> </blockquote> Apart from the general yes/no question....<br> (and I haven't looked deep into language design..., still...)<br> <br> If for arguments sake, it was a yes:<br> <br> 1) "begin/end" are compound statements, not scopes (even mentioned on the big forum thread)<br> 2) If a "inline scope" existed, no mention of "inline var" only at the start thereof.<br> 3) same keyword "var" but significant difference: block vs single statement (one var only)<br> <br> Currently (not tested), but from description<br> <br> <pre> if foo then begin writeln; var bar: integer = 1; // mid (implied) scope readln; end;</pre> <br> So within the "for arguments sake", shouldn't it then be<br> <pre> if foo then // optional introduction of new keyword to start scope var // "var" starts scope (and must be followed by "begin" bar: integer = 1; bar2: integer = 2; begin writeln; readln; end;</pre> <br> - Without a "scope keyword" => "var" starts the new scope. That scope covers the next statement (which must be compound begin/end).<br> - var block ends at begin (which starts the statement for which the scope will last)<br> <br> And the "for var i := <br> is inconsistent. Its the only one that allows "var" mid-statement. (wel, its the only(?) LHS that can be mid statement...)<br> <br> <br> <blockquote type="cite" cite="mid:8774722.NVGHFGmpDH@graeme-linux-desktop"> <pre wrap="" class="moz-quote-pre">Any word on multi-line text blocks? ;-) Coming from Java, I so MISS that in Object Pascal! :-D</pre> </blockquote> <br> Aren't they in 3.3.1 already? And 2 forms? backtick and multi-single-quote? </body> </html> --------------MWK0qw4Caoockdh0y3q6fZl5-- --===============4958342729995374496== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ fpc-pascal maillist - [email protected] https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal --===============4958342729995374496==--