Re: Discuss changing the behaviour of append()
- Posted by gimlet Jun 09, 2014
- 5134 views
I think the basic problem is that S[i] is not (fully) a sequence.
Every slice is a sequence,
S[i] has a length so it is a sequence,
Yet it can type as an atom.
It seems what you need here is an operator which 'converts' an atom to a sequence.
S[i] & {} -- would work as well as S[i..i] -- but they are fixes
but perhaps we need an explicit operator which minimises the cost of the operation.
I really don't think putting the burden on append is appropriate as you would need to do the same with other functions (prepend ..)
and
append has the right to expect a sequence as parameter
(otherwise why specify types at all?)

