mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
Fix %string-dump and %symbol-dump fields
* libguile/strings.c (scm_sys_string_dump): don't print stringbuf. Print read-only status. (scm_sys_symbol_dump): don't print stringbuf. Print interned status.
This commit is contained in:
parent
dab1ed3767
commit
88ed5759cd
1 changed files with 13 additions and 11 deletions
|
@ -793,8 +793,8 @@ SCM_DEFINE (scm_sys_string_dump, "%string-dump", 1, 0, 0, (SCM str),
|
||||||
"@item shared\n"
|
"@item shared\n"
|
||||||
"If this string is a substring, it returns its parent string.\n"
|
"If this string is a substring, it returns its parent string.\n"
|
||||||
"Otherwise, it returns @code{#f}\n"
|
"Otherwise, it returns @code{#f}\n"
|
||||||
"@item stringbuf\n"
|
"@item read-only\n"
|
||||||
"The string buffer that contains this string's characters\n"
|
"@code{#t} if the string is read-only\n"
|
||||||
"@item stringbuf-chars\n"
|
"@item stringbuf-chars\n"
|
||||||
"A new string containing this string's stringbuf's characters\n"
|
"A new string containing this string's stringbuf's characters\n"
|
||||||
"@item stringbuf-length\n"
|
"@item stringbuf-length\n"
|
||||||
|
@ -836,10 +836,14 @@ SCM_DEFINE (scm_sys_string_dump, "%string-dump", 1, 0, 0, (SCM str),
|
||||||
buf = STRING_STRINGBUF (str);
|
buf = STRING_STRINGBUF (str);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Stringbuf info */
|
if (IS_RO_STRING (str))
|
||||||
e5 = scm_cons (scm_from_locale_symbol ("stringbuf"),
|
e5 = scm_cons (scm_from_locale_symbol ("read-only"),
|
||||||
buf);
|
SCM_BOOL_T);
|
||||||
|
else
|
||||||
|
e5 = scm_cons (scm_from_locale_symbol ("read-only"),
|
||||||
|
SCM_BOOL_F);
|
||||||
|
|
||||||
|
/* Stringbuf info */
|
||||||
if (!STRINGBUF_WIDE (buf))
|
if (!STRINGBUF_WIDE (buf))
|
||||||
{
|
{
|
||||||
size_t len = STRINGBUF_LENGTH (buf);
|
size_t len = STRINGBUF_LENGTH (buf);
|
||||||
|
@ -892,8 +896,8 @@ SCM_DEFINE (scm_sys_symbol_dump, "%symbol-dump", 1, 0, 0, (SCM sym),
|
||||||
"The symbol itself\n"
|
"The symbol itself\n"
|
||||||
"@item hash\n"
|
"@item hash\n"
|
||||||
"Its hash value\n"
|
"Its hash value\n"
|
||||||
"@item stringbuf\n"
|
"@item interned\n"
|
||||||
"The string buffer that contains this symbol's characters\n"
|
"@code{#t} if it is an interned symbol\n"
|
||||||
"@item stringbuf-chars\n"
|
"@item stringbuf-chars\n"
|
||||||
"A new string containing this symbols's stringbuf's characters\n"
|
"A new string containing this symbols's stringbuf's characters\n"
|
||||||
"@item stringbuf-length\n"
|
"@item stringbuf-length\n"
|
||||||
|
@ -917,13 +921,11 @@ SCM_DEFINE (scm_sys_symbol_dump, "%symbol-dump", 1, 0, 0, (SCM sym),
|
||||||
sym);
|
sym);
|
||||||
e2 = scm_cons (scm_from_locale_symbol ("hash"),
|
e2 = scm_cons (scm_from_locale_symbol ("hash"),
|
||||||
scm_from_ulong (scm_i_symbol_hash (sym)));
|
scm_from_ulong (scm_i_symbol_hash (sym)));
|
||||||
|
e3 = scm_cons (scm_from_locale_symbol ("interned"),
|
||||||
|
scm_symbol_interned_p (sym));
|
||||||
buf = SYMBOL_STRINGBUF (sym);
|
buf = SYMBOL_STRINGBUF (sym);
|
||||||
|
|
||||||
/* Stringbuf info */
|
/* Stringbuf info */
|
||||||
e3 = scm_cons (scm_from_locale_symbol ("stringbuf"),
|
|
||||||
buf);
|
|
||||||
|
|
||||||
if (!STRINGBUF_WIDE (buf))
|
if (!STRINGBUF_WIDE (buf))
|
||||||
{
|
{
|
||||||
size_t len = STRINGBUF_LENGTH (buf);
|
size_t len = STRINGBUF_LENGTH (buf);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue