This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Why does the GC frees my function?
- To: guile at sourceware dot cygnus dot com
- Subject: Why does the GC frees my function?
- From: Dimitri Ara <dimitri dot ara at mail dot dotcom dot fr>
- Date: 24 Feb 2000 00:35:53 +0100
Hi,
I'm trying as a test to bind each one of the 26 alphacharacter to a
function. I read a file with the gh_load function containing
--
(bind-key #\a
(lambda ()
(display "a")))
--
then I bind the key with this function (alpha_biding is an array of 26
SCM)
--
SCM
bind_key (key, function)
SCM key;
SCM function;
{
char c;
if (!gh_char_p (key)) {
return SCM_BOOL_F;
}
c = gh_scm2char (key);
if (!isalpha (c)) {
return SCM_BOOL_F;
}
if (isupper (c)) {
c = tolower (c);
}
return alpha_binding[(int) c - (int) 'a'] = function;
}
--
Then I execute it but it seems that the GC frees the function. Why?
Can I tell the gcc not to do it (without binding my function to a
symbol)? Did i use a wrong way to do what i want to do?
As you see, I'm not very familiar (yet) with scheme and even less with
guile.
--
"Alors, je crois savoir ce qui n'allait pas. J'ai désactivé
l'option : Send in rich HTML by default. Et je crois que c'était
ça qui foutait le bordel."
-+- EF in Guide du linuxien pervers : "Bien configurer son Netscape"