Closed danprince closed 8 years ago
Using _copy to clone data before mutating it prevents some methods from working on primitive types like strings. For example, it would seem logical that if you can assoc into an array, you can also assoc into a string.
_copy
import { assoc } from 'zaphod'; 'hello'::assoc(0, 'z') // expecting => 'zello'
The fact that strings are already immutable is not a reason for not allowing this.
In the interests of simplicity, it's easier to just lock the API down to Objects and Arrays for now.
Using
_copy
to clone data before mutating it prevents some methods from working on primitive types like strings. For example, it would seem logical that if you can assoc into an array, you can also assoc into a string.The fact that strings are already immutable is not a reason for not allowing this.