danprince / zaphod

🌌 Clojure's API for JavaScript's Objects
https://zaphod.surge.sh
MIT License
54 stars 1 forks source link

Think about easing away from _copy #14

Closed danprince closed 8 years ago

danprince commented 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.

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.

danprince commented 8 years ago

In the interests of simplicity, it's easier to just lock the API down to Objects and Arrays for now.