Stefan Behnel wrote: > Lisandro Dalcin wrote: >> On Thu, Jun 11, 2009 at 2:06 PM, Stefan Behnel<[email protected]> wrote: >>> When I see a C array, I think of a memory block with a sequence of >>> identically typed items. I also think of a Python tuple because that >>> behaves very similar. I totally do not think of a math vector, because that >>> is a very (very!) special use case. >> Well, for me it is not a matter about how do think of view an array, >> but what do you want to do with an array. Could you tell me (apart >> from char/wchar_t because of byte/unicode strings) how many times in >> your life as a programmer did you need to concatenate an array of let >> say integers or double precision floats ? That (I mean, concatenation) >> is for me a very (very!) special use case for arrays... > > Have you never concatenated tuples? I consider this the usual chicken and > egg problem. If the functionality was available, people would use it.
I can actually attest to this. In my primary language these days, R (very much a componentwise language), I find myself doing cbind(arr1, arr2) for concatenating column-wise, rbind(arr1, arr2) for concatenating row-wise, and c(1, 2, 3, arr1) for unpacking concatenation all the time. Only in situations where speed is not an issue though. (Of course, I use componentwise + even more often -- but having available functions doing this even in the componentwise case would be nice). BTW, all of Stefan's examples been one-dimensional, which doesn't quite fit with the CEP which has a strong many-dimensional emphasis (or at least that was the point). Would + only work for 1D, or would it always add along the first dimension (i.e. like rbind above)? How to add along other dimensions? -- Dag Sverre _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
