On 2/1/07, Christopher Barker <[EMAIL PROTECTED]> wrote:
Zachary Pincus wrote: > Say a function that (despite Tim's pretty > reasonable 'don't do that' warning) will return true when two arrays > have overlapping memory? I think it would be useful, even if it's not robust. I'd still like to know if a given two arrays COULD share data. I suppose to really be robust, what I'd really want to know is if a given array shares data with ANY other array, i.e. could changing this mess something up? -- but I'm pretty sure that is next to impossible
It's not totally impossible in theory -- languages like Haskell and Clean (which I'm playing with now) manage to use arrays that get updated without copying, while still maintaining the illusion that everything is constant and thus you can't mess up any other arrays. While it's fun to play with and Clean is allegedly pretty fast, it takes quite a bit of work to wrap ones head around. In a language like Python I expect that it would be pretty hard to come up with something useful. Most of the checks would probably be too conservative and thus not useful -tim -- //=][=\\ [EMAIL PROTECTED]
_______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion