[fpc-pascal] Feature "Multiline strings" added
Sven Barth
pascaldragon at googlemail.com
Mon Jul 28 19:13:42 CEST 2025
Pierre Muller via fpc-pascal <fpc-pascal at lists.freepascal.org> schrieb am
Mo., 28. Juli 2025, 15:27:
>
>
> Le 28/07/2025 à 10:07, Michalis Kamburelis via fpc-pascal a écrit :
> > 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.
>
> I think that a possible solution would be to allow to restrict the mode
> switch to allow
> only triple-quote or only backquote delimiter.
>
> The idea is simply to add:
> {$modeswitch multilinestrings triplequote}
> and
> {$modeswitch multilinestrings backquote}
>
We will *not* extend the modeswitch directive for something like that.
Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20250728/e4e3b04e/attachment.htm>
More information about the fpc-pascal
mailing list