Open erjiang opened 13 years ago
Yes, they should be mutable. But do you really need it? string-set! implemented with immutable JavaScript strings may not be so fast.
I opened this issue merely because I was concerned for the semantics of strings and also for convenience for the user who might want to use string-set!. Speed obviously won't be good, but that could be an implementation note. It's halfway done in https://github.com/erjiang/biwascheme/tree/string-obj if you're interested.
In BiwaScheme, (eq? "hi" "hi") => #t
but should be #f, since strings should be heap-allocated objects in usual Schemes. This can be solved by making a BiwaScheme String object to take advantage of native JS ==. Additionally, this allows for mutable strings because the String object's wrapped value can simply be replaced.