Recursion in foreign-safe-lambda

Massimo Nocentini via Chicken-users <[email protected]>
Newsgroups gmane.lisp.scheme.chicken
Message-ID <[email protected]>
Dear list,

I have a question about the foreign module. Given the following definition:

    (defineparse(foreign-safe-lambda*scheme-object(((constc-string)
    filename))
    "C_word out = P(filename); C_return(out);"
    ))

and

    externC_wordP(constchar*filename)
    {
    char*str="hello world";
    intlength=strlen(str);
    C_word*ptr=C_alloc(C_SIZEOF_STRING(length));
    C_wordres=C_string(&ptr, length, str);
    returnres;
    }

When I use the parse function on a string, I get the following output:
#(#<procedure> #<procedure C_values> (#(#<procedure> #...
How can I allocate Scheme object from a C function (possibly recursive)?
Thank you all in advance,
Massimo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.