Re: Discuss changing the behaviour of append()

new topic     » goto parent     » topic index » view thread      » older message » newer message

I think it's a mistake to refer to it as a promotion of an atom to a sequence.

<built-in> function append(object target, object x) 

Adds object x as the last item in target.

Returns:

A sequence whose first elements are those of target and whose last element is x.

Comments:

The length of the resulting sequence will be length(target) + 1, no matter what x is.

If x is an atom this is equivalent to result = target & x. If x is a sequence it is not equivalent. If target is an atom then it becomes the first element of the new sequence.


Then add in some of the new examples, but probably no more than 3 to 4. It might be useful to unify the examples given between this post, the & operator, and prepend.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu