mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-02 04:40:29 +02:00
Make `symbol->string' return a read-only string.
* libguile/strings.c (scm_i_symbol_substring): Return a read-only string since R5RS requires `symbol->string' to return a read-only string. Reported by Bill Schottstaedt <bil@ccrma.Stanford.EDU>. * test-suite/tests/symbols.test: Add `define-module' clause. (exception:immutable-string): Adjust to current exception. ("symbol->string")["result is an immutable string"]: Use `pass-if-exception' instead of `expect-fail-exception'. * NEWS: Update.
This commit is contained in:
parent
0bf4fe19a6
commit
40de0323e7
3 changed files with 8 additions and 7 deletions
|
@ -491,7 +491,7 @@ scm_i_symbol_substring (SCM sym, size_t start, size_t end)
|
|||
scm_i_pthread_mutex_lock (&stringbuf_write_mutex);
|
||||
SET_STRINGBUF_SHARED (buf);
|
||||
scm_i_pthread_mutex_unlock (&stringbuf_write_mutex);
|
||||
return scm_double_cell (STRING_TAG, SCM_UNPACK(buf),
|
||||
return scm_double_cell (RO_STRING_TAG, SCM_UNPACK (buf),
|
||||
(scm_t_bits)start, (scm_t_bits) end - start);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue