[plt-scheme] Simple question about MzScheme embbeded

From: Daniel CAUNE (d.caune at wanadoo.fr)
Date: Thu Oct 31 16:21:03 EST 2002

It seems that the function scheme_make_provided_string may fit my need. I
was really too hurried... ;-)

----- Original Message -----
From: "Daniel CAUNE" <d.caune at wanadoo.fr>
To: <plt-scheme at list.cs.brown.edu>
Sent: Thursday, October 31, 2002 10:10 PM
Subject: [plt-scheme] Simple question about MzScheme embbeded

>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> Hi,
> I'm trying to embed MzScheme into a C/C++ application. I've began to read
> the documentation "Inside PLT MzScheme" Matthew Flatt has written. The
> example works perfectly. However, I would like to convert the result of a
> symbolic expression evaluation, the function scheme_eval_string returns,
> a string.
> I took a look to the documentation's index, and I found the function
> scheme_get_string. Because I'm so hurried to get my example working, I
> my chance with this function, even, it would be better to read the
> Matthew's documentation before...
> Scheme_Object * result = scheme_eval_string(sexp,  m_schemeEnvironment);
> char * buffer = new char[256];
> scheme_get_string(NULL, result, buffer, 0, 256, 0, 0, NULL);
> Oups.... my computer complains an access violation! Seems that this
> doesn't work like I supposed it does. Could you please give me some clues?
> Which is the function that fits my need? Do I have to test the type of the
> Scheme object, and to call the corresponding function to retrieve the
> (such as scheme_get_int_val for an integer value)?
> Thanks,
> Daniel

Posted on the users mailing list.