Summary

utf8-srfi-13 string-map! does not update in-place

Metadata

Description

 (use srfi-13)
 (define str "foo")
 (string-map! (lambda (c) #\x) str) ;; => "xxx"
 str ;; => "xxx"



 (use utf8-srfi-13)
 (define str "foo")
 (string-map! (lambda (c) #\x) str) ;; => "xxx"
 str ;; => "foo"

Changes and comments

[2016-01-07 20:05:40 UTC] mario set keywords to urf8, srfi-13

[2016-01-07 20:05:40 UTC] mario changed status from new to assigned

[2016-01-07 20:05:40 UTC] mario changed component from unknown to extensions

[2016-01-07 20:05:40 UTC] mario set owner to ashinn

[2016-01-08 00:27:38 UTC] ashinn wrote:

This is intentional - it would be super slow to do otherwise.

[2016-01-08 01:26:10 UTC] evhan wrote:

Would it be better to signal an error indicating that in-place mapping is unsupported? The current behaviour leads to more subtle bugs.

[2016-01-09 14:11:40 UTC] ashinn changed status from assigned to closed

[2016-01-09 14:11:40 UTC] ashinn set resolution to fixed

[2016-01-09 14:11:40 UTC] ashinn wrote:

I really hate this API, but since the sole purpose is SRFI-13 compatibility I've gone ahead and fixed it to update in place.

If you know you might want to use the utf8 egg, you should never use string-map! in programs.