[fpc-pascal] Feature "Multiline strings" added

Michalis Kamburelis michalis.kambi at gmail.com
Mon Jul 28 17:59:32 CEST 2025


> Your argument makes no sense.  There's always been multiple ways to do
> many things in pascal, and it's never caused any more confusion than any
> other typical language construct.

I don't think the comparison to "multiple ways to write a comment" is
proper here. Because various ways to write comments, { } and (* *) and
//, have all their use-cases. In particular, you can write

(*
{ Some comment about Foo. }
procedure Foo;
begin
end;
*)

to comment entire Foo, with all its comments. This is useful. We all
probably used this feature from time to time.

This is different than 2 ways to write multi-line strings, which
really achieve the same, I feel.

Moreover, in case of multi-line comments, the additional confusion
(which I still think is possible) is because there are {$xxx} compiler
directives changing their behavior, and some of them apply only to
backtick-style, some only to ''' style, and from their naming
($MULTILINESTRINGLINEENDING / $TEXTBLOCK) it's not clear which applies
to which. We will have to remember that $MULTILINESTRINGLINEENDING is
for backticks-style, and $TEXTBLOCK is for '''-style.

That is why I say that it's not optimal to have 2 ways to do the same
thing. The language is more obvious to read and write if we don't need
to deal with 2 ways to achieve the same.

On the same ground, we would all protest if someone tried to introduce
alternative way to write "assignment operator", just because some
people would like to write "A := B", while others "A <- B". It's not
that ":=" or "<-" is better, it's that "one version of doing it should
be enough".

( But I do recognize that my comparison above is also flawed. Because
comparisons are usually somewhat simplifying the reality. E.g. what if
Pas2js had an alternative assignment operator, for some good reason?
Anyhow, this is going to off-topic. My focus and my point in this
thread was on the multi-line strings case. And I guess this is already
decided, we'll have both, I can certainly live with this :), I'll just
have to explain to people who I teach about these 2 ways. )

Regards,
Michalis


More information about the fpc-pascal mailing list