From Andre@G||||bert @end|ng |rom chu-rouen@|r  Sun Dec  5 14:56:27 2021
From: Andre@G||||bert @end|ng |rom chu-rouen@|r (GILLIBERT, Andre)
Date: Sun, 5 Dec 2021 13:56:27 +0000
Subject: [Rd] string concatenation operator (revisited)
In-Reply-To: <20211205152212.3b7a6806@Tarkus>
References: <MWHPR1001MB2384CD0939331AF4B4DE9C41CF6B9@MWHPR1001MB2384.namprd10.prod.outlook.com>
 <00df01d7e97f$74cc8d80$5e65a880$@verizon.net>, <20211205152212.3b7a6806@Tarkus>
Message-ID: <a6c3a2ab3af8492b8ef6a2670f833e9f@chu-rouen.fr>

Ivan Krylov <krylov.r00t at gmail.com> wrote:
> FWIW, Perl5 has a separate string concatenation operator (".") in order
> to avoid potential confusion with addition. So do Lua (".."), SQL
> ("||", only some of the dialects) and Raku ("~", former Perl6).


Indeed, using the same operator '+' for addition and string concatenation is not a great idea in my opinion.
Accidental character arguments to a '+' that meant to be a numerical addition would go undetected. Bug tracking would be harder in that case.

R is already too permissive: it finds some interpretation of most probably buggy code, such as ifelse() on vectors of unequal length or '[' operator with only one argument to index a matrix. I would not want to add new permissive behaviors.

A new operator, dedicated to string concatenation, such as %+% or %.%, would be better, in my opinion.

--
Sincerely
Andr? GILLIBERT

	[[alternative HTML version deleted]]



[Rd] string concatenation operator (revisited)
GILLIBERT, Andre