[fpc-pascal] Feature "Multiline strings" added
Michael Van Canneyt
michael at freepascal.org
Mon Jul 28 11:21:34 CEST 2025
On Mon, 28 Jul 2025, Michalis Kamburelis via fpc-pascal wrote:
> Michael Van Canneyt wrote:
>> Personally, I prefer the backtick solution.
>> The triple quote is slow, it requires postprocessing the string.
>> The backtick solution needs only one pass.
>>
>> <rant>
>> I positively HATE it when people start treating whitespace as
>> significant. No YAML or Python for me on that account alone.
>> The triple quote solution (presumably Python inspired)
>> is a totally braindead and retarded solution as far as I am concerned.
>> </rant>
>>
>> You can guess from that little rant that I myself will certainly not
>> remove or even deprecate the backtick version.
>>
>> If having one soluton for all is the norm, we need to remove a lot more
>> things from FPC that Delphi did differently than we do. We don't do that either.
>> Compatibility, yes. But that should not prevent us from doing things our own
>> way from time to time.
>>
>> The solution is simple:
>> if you don't like the backticks, don't use them.
>>
>
> I can see how this can get into a heated discussion (hopefully it will
> not!) :) You have the last word when it comes to FPC decisions,
> obviously. Still, let me try to present the case for "deprecate
> backticks" again.
>
> The problem with your solution """if you don't like the backticks,
> don't use them.""" -> is that it means we have 2 ways to achieve the
> same thing in the Pascal language, to the end of time, and users
> *will* get confused about them and we have 2x more work to explain it.
> Things like indentation, crlf/native/etc., what happens with last line
> -> they have now 2 different behaviors, and people who work with
> various Pascal code (Pas2js, FPC, Delphi) will need to grok them both
> and remember which {$xxx} affects which. This makes things harder --
> to document, to teach, and to not confuse ourselves when reading alien
> code.
>
> For me, solving the above problem ("less confusion by not having 2
> syntaxes for same thing") is really more important.
If this argument is to carry any weight, then we also need to remove
all instances where FPC did things differently from Delphi:
- operators
- nested comments
- duplicate names in objects
- generics. The FPC implementation differs wildly from Delphi.
- anonymous functions explicitly are interfaces.
- We allow nested functions for function references
- use of @
And I am probably forgetting some.
[snip]
>
> ... which makes the indentation looks worse. 2x "something" is now at
> the same level as "begin".
You forget the directive to remove whitespace. It is intended for exactly this purpose.
>
> And I'm not saying that FPC should now adjust to Delphi by removing
> all FPC-specific features. Let's not generalize
You are not saying it, but your argument implies it.
The 'less confusion' argument is invalidated if you apply it randomly to
some particular feature and not to others.
That is for me the heart of the matter and a matter of principle:
Either we adjust to Delphi, or we allow ourselves some freedom.
I am perfectly capable to set aside my personal preferences and adjust.
But I chose the latter - the freedom to do things differently -
in the interest of compatibility with pas2js:
If it was not for pas2js, we would not have extended RTTI, we would not have
webassembly and some other things. Pas2js was and is - and I am serious -
vital for FPC's advancement in todays world.
Which means compatibility with this vital piece is important too.
If pas2js weren't there, I would simply have adapted the existing
implementation to handle the ''' approach, despite the horror this
construct arouses in me.
But pas2js exists, I believe it is important, and that explains my decision.
Michael.
More information about the fpc-pascal
mailing list