<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<br>
<div class="moz-cite-prefix">Am 03.06.2018 um 18:12 schrieb Sven
Barth via fpc-pascal:<br>
</div>
<blockquote type="cite"
cite="mid:CAFMUeB_Na28E2zj54mtZYBw=caFEVTnrYwiwg3_HCAU7PhSBHQ@mail.gmail.com">
<div dir="auto">
<div class="gmail_quote" dir="auto">
<div dir="ltr">Bernd Oppolzer <<a
href="mailto:bernd.oppolzer@t-online.de"
moz-do-not-send="true">bernd.oppolzer@t-online.de</a>>
schrieb am So., 3. Juni 2018, 11:56:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<p><br>
</p>
<br>
<div class="m_2994146323108775748moz-cite-prefix">Am
02.06.2018 um 15:14 schrieb Sven Barth via fpc-pascal:<br>
</div>
<blockquote type="cite">
<div dir="auto">
<div class="gmail_quote" dir="auto">
<div dir="ltr">Mark Morgan Lloyd <<a
href="mailto:markMLl.fpc-pascal@telemetry.co.uk"
target="_blank" rel="noreferrer"
moz-do-not-send="true">markMLl.fpc-pascal@telemetry.co.uk</a>>
schrieb am Sa., 2. Juni 2018, 10:53:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">However
as Dennis points out + is also essential for
vector operations. <br>
Perhaps either leaving it to the programmer to
define what's needed <br>
would be the best approach, or alternatively
splitting dynamic arrays <br>
into mathematical vectors and non-mathematical
collections. Or relaxing <br>
the requirement that only predefined operators can
be redefined, so that <br>
something like _ could be used for concatenation.<br>
</blockquote>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">That needlessly complicates the parser
as the compiler still needs to know them and they
also need to be part of its operator precedence
rules. Don't complicate the language for nothing!
And in the end operator overloads are one of the
best examples for syntactic sugar as you can easily
achieve the same result with functions and methods. </div>
<div dir="auto"><br>
</div>
<div dir="auto">Regards, </div>
<div dir="auto">Sven </div>
</div>
<br>
</blockquote>
<br>
This is somehow off topic of course, <br>
but IMO it is strange to use + for string concatenation; <br>
I always have bad feelings about this. This whole thread
would <br>
not exist, if FreePascal had gone another direction like
PL/1, for example, <br>
where the string concatenation operator is ||<br>
(and DB2, and - probably - other SQL dialects).<br>
</div>
</blockquote>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">FPC inherited the +-operator for concatenation
from the base language: Pascal. So there simply was no other
route to take (not that anyone would have thought to take a
different route). </div>
<div dir="auto"><br>
</div>
<div class="gmail_quote" dir="auto">
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF"> <br>
Where does this + for string concat come from? <br>
</div>
</blockquote>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">Ask Wirth, he is the one who invented Pascal... </div>
<div dir="auto"><br>
</div>
</div>
</blockquote>
<br>
AFAIK, the Pascal Standard (ISO) does not tell anything about
strings<br>
and concatenation. Wirth did not include varying length strings into
<br>
the language in the 197x years. Every Pascal compiler which contains
<br>
strings and concatenation does this by extending the Pascal Standard<br>
and can choose its own way to do it. <br>
<br>
IBMs Pascal/VS uses || for string concatenation (inspired by PL/1,
probably), <br>
and that's what I implemented in the New Stanford Pascal compiler,
too. <br>
<br>
The + for concatenation must be an invention of Turbo Pascal or UCSD
Pascal <br>
or something like that. <br>
<br>
<blockquote type="cite"
cite="mid:CAFMUeB_Na28E2zj54mtZYBw=caFEVTnrYwiwg3_HCAU7PhSBHQ@mail.gmail.com">
<div dir="auto">
<div dir="auto">Regards, </div>
<div dir="auto">Sven </div>
</div>
<!--'"--><br>
</blockquote>
<br>
</body>
</html>