This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: printed representation -> C string



On Sun, 25 Jan 1998, Mark Galassi wrote:
> 
> 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.
> 

As far as I can tell, that's not quite what I want. I have something like
this:
 SCM the_results = gh_eval_str ( str );

 And now I want to convert the_results to a nice human-readable string
representation regardless of type. gh_symbol2newstr() dies, for example,
if str evaluates to an integer rather than a symbol. If the_results is an
integer, I want the string "1", or if it's unspecified, "#<unspecified>",
or if it's false "#f", just like the (display) procedure, only to a string
rather than to stdout. Am I making sense? (entirely possible I'm not... :) 

Thanks very much,
 Havoc Pennington