Re: Discuss changing the behaviour of append()

new topic     » goto parent     » topic index » view thread      » older message » newer message
SDPringle said...

I believe among new users or infrequent users, if a user passes an atom as a first argument to append, it is probably because they are accidentally reversing the order of the parameters and not because they want to treat atoms as length-one sequences that contain that atom.

I was just going to say something similar, in particular str=prepend(ch,str) has been nicely caught for me a few times, but to be honest if I know I'm adding an atom, I'll use &, and if I'm adding a sequence, the extra type check helps not one tiny bit.

However, I would like to suggest appenda() [and prependa], see what people have to say about that. Or maybe appendany()/prependany() if you prefer.

Pete

Edit: "Why must append have a sequence as the first parameter and concatenate doesn't?"
That certainly hits the nail on the head. Apart from "trying to be helpful but not really managing it", I got no answer to that.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu