On 01/04/12 16:01, Ludovic Courtès wrote:
BTW, were you able to find a stripped-down example that reproduces the
‘string-upcase’ problem?

Here's the stripped down example, but it does not reproduce the problem.  :(
I didn't copy into it my variation on scm_c_eval_string, but I hope
that isn't the issue.  Must be some subtle interaction somewhere....

#include <stdio.h>
#include <libguile.h>

static SCM
my_get(void)
{
    static char const zNil[] = "";
    SCM res = scm_from_locale_string(zNil);
    printf("zNil at %p yields SCM 0x%llX\n", zNil, (unsigned long long)res);
    return res;
}

static void
inner_main(void * closure, int argc, char ** argv)
{
    scm_c_define_gsubr("my-get", 0, 0, 0, (scm_t_subr)(void*)my_get);
    scm_c_eval_string("(define a (my-get))"
                      "(define b (string-upcase a))"
                      "(exit 0)");
}

int
main(int argc, char ** argv)
{
    scm_boot_guile(argc, argv, inner_main, 0);
    return 0; /* NOTREACHED */
}

Reply via email to