diff options
author | Ludovic Courtès <ludo@gnu.org> | 2008-09-22 23:03:20 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2008-09-23 18:45:27 +0200 |
commit | fb2f8886c4d537b0c7d3e9e78a8d4e5e272a36f4 (patch) | |
tree | 16d6bbddb4c7ef0078f727dfb991e23fda94a79a /libguile/macros.c | |
parent | fd2b17b9cb7aaa6b550ad9b6a3efe3c53c94ccce (diff) | |
download | guile-fb2f8886c4d537b0c7d3e9e78a8d4e5e272a36f4.tar.gz |
Make literal strings (i.e., returned by `read') read-only.
* libguile/read.c (scm_read_string): Use `scm_i_make_read_only_string ()' to
return a read-only string, as mandated by R5RS. Reported by Bill
Schottstaedt <bil@ccrma.Stanford.EDU>.
* libguile/strings.c (scm_i_make_read_only_string): New function.
(scm_i_shared_substring_read_only): Special-case the empty string
so that the read-only and read-write empty strings are `eq?'. This
optimization is relied on by the `substring/shared' `empty string'
test case in `srfi-13.test'.
* libguile/strings.h (scm_i_make_read_only_string): New declaration.
* test-suite/tests/strings.test ("string-set!")["literal string"]: New test.
* NEWS: Update.
Diffstat (limited to 'libguile/macros.c')
0 files changed, 0 insertions, 0 deletions