From ru|pb@rr@d@@ @end|ng |rom @@po@pt  Sun Dec  5 08:41:05 2021
From: ru|pb@rr@d@@ @end|ng |rom @@po@pt (Rui Barradas)
Date: Sun, 5 Dec 2021 07:41:05 +0000
Subject: [Rd] string concatenation operator (revisited)
In-Reply-To: <MWHPR1001MB2384CD0939331AF4B4DE9C41CF6B9@MWHPR1001MB2384.namprd10.prod.outlook.com>
References: <MWHPR1001MB2384CD0939331AF4B4DE9C41CF6B9@MWHPR1001MB2384.namprd10.prod.outlook.com>
Message-ID: <5aa24f01-b224-c19c-c3a4-3b96c27f0413@sapo.pt>

Hello,

Bert Gunter started a very recent R-Help thread [1] about the following 
method not working.

`+.character` <- function(x, y) paste0(x, y)


The discussion is worth reading and at least partly answers to the 
reason why the feature request has never made it to base R.

It goes without saying that I do not speak for the R Core team.


[1] https://stat.ethz.ch/pipermail/r-help/2021-December/473163.html


Hope this helps,

Rui Barradas

?s 22:36 de 04/12/21, Grant McDermott escreveu:
> Hi all,
> 
> I wonder if the R Core team might reconsider an old feature request, as detailed in this 2005 thread: https://stat.ethz.ch/pipermail/r-help/2005-February/thread.html#66698
> 
> The TL;DR version is base R support for a `+.character` method. This would essentially provide a shortcut to `paste?0`, in much the same way that `\(x)` now provides a shortcut to `function(x)`.
> 
>> a = "hello "; b = "world"
>> a + b
>> [1] "hello world"
> 
> I appreciate some of the original concerns raised against a native "string1 + string2" implementation. The above thread also provides several use-at-your-own-risk workarounds. But sixteen years is a long time in software development and R now stands as something of an exception on this score. Python, Julia, Stata, and SQL (among various others) all support native string concatenation/interpolation using binary/arithmetic operators. It's been a surprising source of frustration for students in some of the classes I teach, particularly those coming from another language.
> 
> Many thanks for considering.
> 
> PS. I hope I didn't miss any additional discussion of this issue beyond the original 2005 thread. My search efforts didn't turn anything else up, except this popular Stackoverflow question: https://stackoverflow.com/questions/4730551/making-a-string-concatenation-operator-in-r
> 
> Grant McDermott
> Assistant Professor
> Department of Economics
> University of Oregon
> www.grantmcdermott.com
> 
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>



[Rd] string concatenation operator (revisited)
Rui Barradas