The problem is this:
start = [1, 2];
add = [3,4];
end = ArrayAppend( start, end );
You SHOULD get [1,2, [3,4] ]. Otherwise you would not be able to add
an array as an element to another array (using ArrayAppend).
ArrayAppend should only be overloaded to act like ArrayConcat if
there's a third attribute to specify the behavior difference, at which
point you might as well have a different function name anyway. What's
better:
ArrayAppend( start, end, true );
or
ArrayConcat( start, end );
Lists are always going to be a corner case because they're not
actually their own data type. The List* functions are shorthand for
manipulating a specific format of string.
In
my opinion, ArrayConcat() is semantically better because ArrayMerge()
sounds like "duplicates" between the arrays are removed which is not
the behavior from what I understand.
Otherwise you would not be able to add
an array as an element to another array (using ArrayAppend).
For string concatenation, we do either "String1 & String2" or "String1
&= String2".
Are there any reasons not to use the same syntax for arrays?
--
CFML Conventional Wisdom
http://groups.google.com/group/cfml-conventional-wisdom?hl=en?hl=en
Hmm, though I guess there's still ambiguity with possibly doing
[1,2,3] & [4,5,6] and getting [14,25,36] instead.
--