Am 03.07.19 um 18:53 schrieb Ben Grasset:
On Wed, Jul 3, 2019 at 10:22 AM Marcus Sackrow <al...@web.de
<mailto:al...@web.de>> wrote:

    I use an operator overload(not for constants but inside the code)
    because I'm used to our script engine have the '/' as operator for
    strings as line break.


That's certainly a neat use of operator overloading! However, I think
that it is still rather less clean/readable than what would be
possible with "true" unbroken multiline strings.
For really short stuff like your writeln example, also, it's not much
different from just doing the following, which is already supported:

writeln('1st line'#13#10'second line');

or

writeln('1st line'#10'second line');

BTW, doing it with an operator like that introduces quite a bit of
additional overhead, as the concatenation is no longer done at compile
time.


Sure I meant with that, if a new scheme would be introduced to make
multiline strings easier, i would prefer such operator, then as real
compiler operator also for constants and so on. Mine is just a
workaround. (the operator would also automatically select the right line
ending, mabye defined together with decimalseparator in formatsettings)

real multiline strings, I do not like, because they look ugly in a well
indented code... so your initial example taken would have an awful lot
of spaces in front of all lines, exept the first one.


Greetings,

Marcus

_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to