[edit]

Hello fellow Wikipedians,

I have just modified one external link on Append. Please take a moment to review my edit. If you have any questions, or need the bot to ignore the links, or the page altogether, please visit this simple FaQ for additional information. I made the following changes:

When you have finished reviewing my changes, please set the checked parameter below to true or failed to let others know (documentation at {{Sourcecheck}}).

This message was posted before February 2018. After February 2018, "External links modified" talk page sections are no longer generated or monitored by InternetArchiveBot. No special action is required regarding these talk page notices, other than regular verification using the archive tool instructions below. Editors have permission to delete these "External links modified" talk page sections if they want to de-clutter talk pages, but see the RfC before doing mass systematic removals. This message is updated dynamically through the template {{source check}} (last update: 5 June 2024).

  • If you have discovered URLs which were erroneously considered dead by the bot, you can report them with this tool.
  • If you found an error with any archives or the URLs themselves, you can fix them with this tool.

Cheers.—InternetArchiveBot (Report bug) 14:34, 16 October 2016 (UTC)[reply]

Append vs. prepend vs. concatenate

[edit]

I'd like to see a little discussion distinguishing the concepts of append, prepend, and concatenate. Specifically, I venture that concatenation is more symmetric in that it emphasizes neither the first nor the second argument in binary operations. In contrast, append means to take a second something and put it after a first something. Furthermore, prepend means to take a second something and put it before a first something.

concatenate(x, y) = x.append(y) = y.prepend(x)

Assuming that this is something that textbooks distinguish, what should we say in this article? —Quantling (talk | contribs) 22:01, 8 December 2023 (UTC)[reply]

Is the article meant to be about the general concept of appending, or about specific functions/predicates called "append" that exist in various programming languages? It seems to be mostly describing the latter, though it goes on to talk about features in a random few languages that aren't named "append" at all. Furthermore, in my mind "append" is at least primarily a verb, but the lead sentence describes it as a noun (albeit marked up as code).
To me, "append y to x" means modify x to be the concatenation of x and y as was immediately before the operation. You can append to a file, meaning the same thing. On the other hand, "concatenate" implies simply joining the strings, arrays, lists or whatever together, and where you put or what you do with the result of the operation is on the back of this.
So by the names, I would probably expect
  • concatenate(x, y) to return x and y joined together and not modify either variable
  • x.append(y) to modify x, and possibly return the modified x as a convenience (this is what .NET StringBuilder.Append does, for instance, if this counts on the basis that StringBuilder is essentially a mutable string class)
  • y.prepend(x) to modify y, and possibly return the modified y as a convenience
Smjg (talk) 11:44, 19 December 2025 (UTC)[reply]
I agree with your bullets. I think we should say something like this in the article. —Quantling (talk | contribs) 16:04, 19 December 2025 (UTC)[reply]
The article is a mess. It lacks a clear focus. From the history, I see that originally it was specifically about the Lisp append function. Subsequent edits have been a mishmash of:
  • Builtins in other languages called append that do the same thing.
  • Implementations of array/list concatenation in other languages.
  • Builtins to do the same in other languages that aren't called append at all.
Furthermore, the selection of languages covered is arbitrary. All the article is showing is how to do, in a small selection of languages, something for which there is a better-agreed-upon standard name: concatenation. I see that article purports to be about string concatenation specifically, but it isn't entirely - one section is about concatenation of audio snippets. In any case, there's no real reason to for it to be about concatenation of a single data type. That article should be generalised to cover concatenation of arrays and lists (of which strings are typically an example) generally, and relevant content from this article moved there. I'll propose a merge. — Smjg (talk) 21:04, 22 December 2025 (UTC)[reply]