I agree with you that duplication is usually useless (whether add truncates or not). If anything, I like having the functions because I think they add some consistency: if I want the distance between two vectors, I use distance(). If I want the dot product, I use dot(). So if I wanted to add two vectors, I think the first thing I'd think of would be to look for a function that does that. Whatever happens with the function names, I'll be sure to be clear that the arithmetic functions truncate.Macciza wrote:Hi Brian
I just meant that add function as '+' was already there, which is at he used then 'wrap'ed to the shorter length - I guess I'm used to MutableArrays . . .
I was not sure if you realised the maths operators +-/* already worked on arrays but at longer length making AB code that much simpler as {array}+{array} is already standard within Lemur, rather then iterating though.
I guess ultimately the fact that it is 'add' as opposed to '+' it probably ok - I guess I just wanted the built-in Lemur array maths operators where not thought to be missing or inapplicabble to arrays.
The code optimisation thing was just that there are the inbuilt functions which may be faster, more so than the one-liner thing
Thanks, though, for pushing me to think about this stuff. Since my goal is for modules like this to be useful to more people than just me, it's tremendously helpful to get other perspectives.