Re: printed representation -> C string

Mark Galassi (rosalia@cygnus.com)
Sun, 25 Jan 1998 21:36:37 -0700

Hi Robert,

If I understand what you are saying, you might want to use the
function gh_symbol2newstr(). You will find it documented in the Guile
reference manual, as part of the gh_ interface.

Here's the entry for gh_symbol2newstr from guile-ref.info:

- Function: char *gh_symbol2newstr (SCM SYM, int *LENP)
Takes a Scheme symbol and returns a string of the form
`"'symbol-name"'. If LENP is non-null, the string's length is
returned in `*LENP'.

This function uses malloc to obtain storage for the returned
string; the caller is responsible for freeing it.