chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] a couple of questions about foreign functions


From: Valentyn Kamyshenko
Subject: [Chicken-users] a couple of questions about foreign functions
Date: Wed, 21 Jan 2004 20:05:34 -0800
User-agent: Gnus/5.1002 (Gnus v5.10.2) XEmacs/21.5 (celeriac, berkeley-unix)

Hello:

a couple of questions:

- in the chicken code, the Scheme strings seem to be never created on
the stack. Are there particular reasons for this? I mean, is
smth. wrong with the following piece of code:

(foreign-lambda* scheme-object () #<<EOF
char buf[13+sizeof(C_header)];
((C_SCHEME_BLOCK*)(void*)buf)->header=C_make_header(C_STRING_TYPE,13);
memcpy(((C_SCHEME_BLOCK*)(void*)buf)->data, "Hello, world!", 13);
return(buf);
EOF
)

- are there advantages/disadvantages of using foreign-lambda* instead
of ##core#primitive function in terms of performance or they are more
or less equivalent?

- can I call error routines from C code (that is, inside
foreign-lambda*, for example)?

Thanks a lot,

        Valentyn.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]