Hi all !

As I am sure most people here know, functional programmers prefer to use non-mutable data, very often lists. There are also non-mutable arrays. Now, in J development, we talk about operations in place, which seems to go in opposite direction, from the mainly non-mutable arrays we have to mutable arrays. Is there an analysis which shows that this is the right way to go?

Another option would be to use non-mutable arrays, specifically array classes structured in such a way that you can create a copy which reuses the old unchanged content and then change the contents of this copy. Usually you can create a mutable array and define its content, then make it non-mutable before you return it.

I tried non-mutable array in F#, and they seem slow compared to ordinary arrays, but on some of them a copy operation was very fast. I am not sure of how using such arrays would affect the performance of our systems.

Cheers,

Erling Hellenäs

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to