Clinton Ebadi <[EMAIL PROTECTED]> writes: >> Is this okay, and in case not, is there a better way to convert a >> char* into a guile string? > > SCM_API SCM scm_from_locale_string (const char *str); > SCM_API SCM scm_from_locale_stringn (const char *str, size_t len); > SCM_API SCM scm_take_locale_string (char *str); > SCM_API SCM scm_take_locale_stringn (char *str, size_t len);
Err, the other way around SCM_API char *scm_to_locale_string (SCM str); SCM_API char *scm_to_locale_stringn (SCM str, size_t *lenp); SCM_API size_t scm_to_locale_stringbuf (SCM str, char *buf, size_t max_len); Granted they all return a fresh string (or store a copy into a preallocated buffer), but this allows the internal Guile string representation to be fancier than a byte array if needed by hiding the internal representation. This will be important when Guile supports things like Unicode (e.g. like SBCL does by using UCS-32 internally and converting into an external encoding such as UTF-8 when needed so as to preserve O(1) string operations and still work with the outside world). -- How can you accept social supression This weak state of mind in our time I demand release from hypocrisy I'd rather die than be held down, forced down