similar to: Improving string concatenation

Displaying 20 results from an estimated 20000 matches similar to: "Improving string concatenation"

2015 Jun 17
4
Improving string concatenation
Bad choice of words I'm afraid. What I'm ultimately pushing for is a feature request. To allow string concatenation with '+' by default. Sure I can write my own string addition function (like the example I posted previously) but I use it so often that I end up putting it in every script I write. It is ultimately a matter of readability and syntactic sugar I guess. As an example, I
2015 Jun 17
3
Improving string concatenation
On Tue, Jun 16, 2015 at 8:24 PM, Herv? Pag?s <hpages at fredhutch.org> wrote: [...] > > If I was to override `+` to concatenate strings, I would make it stick > to the recycling scheme used by arithmetic and comparison operators > (which is the most sensible of all IMO). Yeah, I agree, paste's recycling rules are sometimes painful. This could be "fixed" with a nice
2015 Jun 17
2
Improving string concatenation
> How would this new '+' deal with factors, as paste does or as the current '+' > does? Would number+string and string+number cause errors (as in current > '+' in R and python) or coerce both to strings (as in current R:paste and in perl's '+'). I had posted this sample code previously to demonstrate how string concatenation could be implemented
2015 Jun 17
0
Improving string concatenation
Hi Joshua, On 06/16/2015 03:32 PM, Joshua Bradley wrote: > Hi, first time poster here. During my time using R, I have always found > string concatenation to be (what I feel is) unnecessarily complicated by > requiring the use of the paste() or similar commands. > > > When searching for how to concatenate strings in R, several top search > results show answers that say to
2015 Jun 17
0
Improving string concatenation
> ... adding the ability to concat > strings with '+' would be a relatively simple addition (no pun intended) to > the code base I believe. With a lot of other languages supporting this kind > of concatenation, this is what surprised me most when first learning R. Wow! R has a lot of surprising features and I would have thought this would be quite a way down the list. How
2015 Jun 17
0
Improving string concatenation
On Jun 16, 2015 3:44 PM, "Joshua Bradley" <jgbradley1 at gmail.com> wrote: > > Hi, first time poster here. During my time using R, I have always found > string concatenation to be (what I feel is) unnecessarily complicated by > requiring the use of the paste() or similar commands. I don't follow. In what sense is paste complicated to use? Not in the sense of
2015 Jun 18
1
Improving string concatenation
Gabor Csardi writes: > Btw. for some motivation, here is a (surely incomplete) list of > languages with '+' as the string concatenation operator: > > ALGOL 68, BASIC, C++, C#, Cobra, Pascal, Object Pascal, Eiffel, Go, > JavaScript, Java, Python, Turing, Ruby, Windows Powers hell, > Objective-C, F#, Sc-ala, Ya. The situation for R is rather different from that of a
2015 Jun 17
1
Improving string concatenation
Just to clarify, primitive (C-level) generics do not support dispatch on basic classes (like character). This is for performance (no need to consider dispatch on non-objects) and for sanity (in general, redefining fundamental behaviors is dangerous). It is of course possible to define a "+" method with a signature containing a class not in the set of basic classes. On Tue, Jun 16, 2015
2015 Jun 17
3
Improving string concatenation
On Wed, Jun 17, 2015 at 12:45 PM, William Dunlap <wdunlap at tibco.com> wrote: >> ... adding the ability to concat >> strings with '+' would be a relatively simple addition (no pun intended) > to >> the code base I believe. With a lot of other languages supporting this > kind >> of concatenation, this is what surprised me most when first learning R. >
2012 Sep 14
4
concatenating two vectors
Dear all, I want to concatenate the elements of two vectors such as a<-c("a1","a2") b<-c("b1","b2") and obtain "a1b1", "a1b2","a2b1","a2b2" I tried the paste and paste0 functions, but they yielded elementwise concatenation such as "a1b1","a2b2" I am wondering that is there an efficient
2025 Jun 02
2
Specifying a long string literal across several lines
I suppose taste is learned as well. It does feel quite odd that the best way to define a long string without a note or text wrapping is by being creative with functions. This is valid in Python, Julia, and Rust (if you add `let` and a terminating semi-colon): my_str = "part1\ part2\ part2" I don't think it is abnormal to expect or desire this type of functionality in our favorite
2015 Jun 17
0
Improving string concatenation
One of the poster's on the SO post I linked to previously suggested this but if '+' were made to be S4 compliant, then adding the ability to concat strings with '+' would be a relatively simple addition (no pun intended) to the code base I believe. With a lot of other languages supporting this kind of concatenation, this is what surprised me most when first learning R. This is
2025 Jun 02
1
Specifying a long string literal across several lines
On 6/2/25 17:37, Josiah Parry wrote: > Tomas, > > Here is a good example of where this functionality would be useful: > https://github.com/R-ArcGIS/arcgislayers/blob/2b29f4c254e7e5a1dadce8d4b0015a70dfae39d4/R/arc-open.R#L19-L56 > > In order to prevent R CMD check notes I have to use `paste0()` to > concatenate long URLs. If we were able to use `\` to > separate the string
2025 Jun 02
1
Specifying a long string literal across several lines
Tomas, Here is a good example of where this functionality would be useful: https://github.com/R-ArcGIS/arcgislayers/blob/2b29f4c254e7e5a1dadce8d4b0015a70dfae39d4/R/arc-open.R#L19-L56 In order to prevent R CMD check notes I have to use `paste0()` to concatenate long URLs. If we were able to use `\` to separate the string across multiple lines, it would make the solution much nicer! On Mon, Jun
2025 Jun 02
1
Specifying a long string literal across several lines
Like Tomas, I find the paste0 readability to be **much** better, partly because it allows for better indentation (as Tomas pointed out). Perhaps a pointless email, but sometimes - for these subjective issues - it is worthwhile to point out a difference in opinion. Best, Kasper On Mon, Jun 2, 2025 at 12:27?PM Tomas Kalibera <tomas.kalibera at gmail.com> wrote: > > On 6/2/25 17:37,
2025 Jun 02
2
Specifying a long string literal across several lines
One could also argue that paste0("a", "b", "c") is a function call that needs to be evaluated at runtime, whereas "abc" is a string constant understood by the parser, and often also language agnostic. I'd assume compilers and code- and text-search tools do a better job with the latter. /Henrik On Mon, Jun 2, 2025 at 2:18?PM Josiah Parry
2025 Jun 02
2
Specifying a long string literal across several lines
> On 3 Jun 2025, at 09:34, Henrik Bengtsson <henrik.bengtsson at gmail.com> wrote: > > One could also argue that paste0("a", "b", "c") is a function call that needs to be evaluated at runtime, whereas "abc" is a string constant understood by the parser, and often also language agnostic. I'd assume compilers and code- and text-search tools
2025 Jun 02
1
Specifying a long string literal across several lines
On 5/28/25 04:15, Pavel Krivitsky via R-devel wrote: > Dear All, > > Perhaps this should go in r-package-devel, but I suspect that this is > going to turn into a feature request, and I want to run it by the list > before filing it in the Bugzilla. > > I would like to specify a long string literal without making the line > of code too long. In R, > > "abc >
2015 Jun 17
0
Improving string concatenation
if '+' and paste don't change their behavior with respect to factors but you encourage people to use '+' instead of paste then you will run into problems with data.frame columns because many people don't notice whether a character-like column is character or factor. With paste() this is not a problem but with '+' it is. I think it is good not to make people worry
2019 Nov 08
8
improving the performance of install.packages
I could do this...and I have before. This brings up a more fundamental question though. You're asking me to write code that changes the logic of the installation process (i.e. writing my own package installer). Instead of doing that, I would rather integrate that logic into R itself to improve the baseline installation process. This api proposal change would be additive and would not break