[fpc-devel] Some thoughts on multi-line string support, and a possible syntax that I think is perfectly clean and Pascal-ish.

Marco van de Voort fpc at pascalprogramming.org
Thu Jul 4 12:00:07 CEST 2019


Op 2019-07-04 om 07:34 schreef Sven Barth via fpc-devel:
>
>>> But the main question is: do we actually want a multiline string ? 
>>> As far as I am concerned, that question needs to be answered first, 
>>> and for
>>> me personally the answer to that is still a resounding "no".
>>
>> Me too. Mostly overrated IMHO, and ugly as sin exception on general 
>> rules.
>>
>> Also goes for comments, but those have been in for a long time, so 
>> that is a bit moot.
> You are aware that Pascal contained multi line comments (both "(* ... 
> *)" and "{ ... }") before single line comments "// ... " where added? 

Yes. And also that FPC changed them to nest with same time, which 
Borland style does not.

> Though I also don't understand why you think multi line comments are 
> overrated.

I meant multiline literal strings are overrated as feature, the reasons 
against multiline literal strings, besides that I'm in general against 
dialect divergence and complication are:

- not really that often needed. Should every hypothetical need or 
foreign language feature automatically trigger additonal syntax? IMHO No.

- Quite heavy feature because it burdens the language with a concept 
that spans lines, with the usual strange errors on wrong lines resulting 
from it if unbalanced. One of the core things I like about Pascal is 
that its errors are usually in the right line.

- Basically a shorthand, the solution with + works fine. There also 
could be $includefileasstring or something, one of the few extensions in 
recent years that I have been in favor of.

In conclusion:  it is a solution in search of a problem, with bad 
behaviour in errorhandling (when unbalanced the compiler errors on 
perfectly fine code in the wrong place after whatever ' closes the 
unbalanced ) on top of it.

This is why the feature goes against the grain of Pascal IMHO.



More information about the fpc-devel mailing list