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



Thanks! That works very nicely. call-with-output-string is the function I
needed to know about.

Havoc Pennington

On Sun, 25 Jan 1998, thi wrote:
> try this:
> 
> (define (obj->string obj)
>   (define (display-obj port) (display obj port))
>   (call-with-output-string display-obj))
> 
> then, turn
> 
>  SCM the_results = gh_eval_str ( str );
> 
> into
> 
>  wrapped = strcat3 ( "(obj->string ", str, ")" );
>  SCM the_results = gh_eval_str ( wrapped );
> 
> at this point, `the_results', should be a string.
> 
> thi
>