Opened 9 years ago
Closed 9 years ago
#1253 closed defect (fixed)
utf8-srfi-13 string-map! does not update in-place
Reported by: | Caolan McMahon | Owned by: | Alex Shinn |
---|---|---|---|
Priority: | major | Milestone: | someday |
Component: | extensions | Version: | 4.10.x |
Keywords: | urf8, srfi-13 | Cc: | |
Estimated difficulty: |
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"
Change History (4)
comment:1 Changed 9 years ago by
Component: | unknown → extensions |
---|---|
Keywords: | urf8 srfi-13 added |
Owner: | set to Alex Shinn |
Status: | new → assigned |
comment:2 Changed 9 years ago by
comment:3 Changed 9 years ago by
Would it be better to signal an error indicating that in-place mapping is unsupported? The current behaviour leads to more subtle bugs.
comment:4 Changed 9 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
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.
Note: See
TracTickets for help on using
tickets.
This is intentional - it would be super slow to do otherwise.