Since the append procedure must completely copy all of its arguments except the last, both its time and space complexity are O(n) for a list of
in Scheme) performs the same function as append, but destructively: it alters the cdr of each argument (save the last), pointing it to the next list.
Calling yields the solutions: In Miranda, this right-fold, from Hughes (1989:5-6), has the same semantics (by example) as the Scheme implementation above, for two arguments.
Note that when opening and closing file handles, one should always check the return value.
Do not confuse with the list method append, which adds a single element to a list: In Bash the append redirect is the usage of ">>" for adding a stream to something, like in the following series of shell commands: The stream "Goodbye world!"