forum-msg-id-124671-edit
Original date:2014-06-21 17:05:11 Edited by: DerekParnell Subject: Re: Discuss changing the behaviour of append()
gimlet said...
Just a question:
Assuming that appending/prepending to atoms is on
we have:
? append(1,{}) -- {1,{}} ? append({},1) -- {1} ? prepend(1,{}) -- {{},1} ? prepend({},1) -- {1}
I'm not saying it's wrong but don't you find the difference strange?
No I don't, because the result is identical to when the first argument is a sequence ...
-- Ensuring that the first parameter is a sequence. ? append({1},{}) -- {1,{}} ? append({},1) -- {1} ? prepend({1},{}) -- {{},1} ? prepend({},1) -- {1} -- Performing the 'equivalent' functionality using concatenate ? {1} & {{}} ? {} & {1} ? {{}}& {1} ? {1} & {}
Or putting the operation into English text ...
- Create a new sequence such that all the elements in the first argument appear at the beginning of the new sequence, in the same order, and the second argument becomes the last argument in the new sequence.
|
Not Categorized, Please Help
|
- history, backlinks
- Last modified Jun 21, 2014 by DerekParnell

