Node:Read Only Strings, Previous:Shared Substrings, Up:Shared And Read Only Strings



36.1.2 Read Only Strings

In previous versions of Guile, there was the idea that some string-based primitives such as string-append could equally accept symbols as arguments. For example, one could write

(string-append '/home/ 'vigilia)

and get "/home/vigilia" as the result. The term read only string was adopted to describe the argument type expected by such primitives.

This idea has now been removed. The predicate read-only-string? still exists, but deprecated, and is equivalent to

(lambda (x) (or (string? x) (symbol? x)))

But no Guile primitives now use read-only-string? to validate their arguments.

String-based primitives such as string-append now require strings:

(string-append '/home/ 'vigilia)
=>
ERROR: Wrong type argument (expecting STRINGP): /home/

read-only-string? obj Deprecated Scheme Procedure
scm_read_only_string_p (obj) Deprecated C Function
Return #t if obj is either a string or a symbol, otherwise return #f.