This is the mail archive of the
mailing list for the Guile project.
global objects in C
- To: <email@example.com>
- Subject: global objects in C
- From: "Keisuke Nishida" <firstname.lastname@example.org>
- Date: Wed, 11 Aug 1999 00:45:46 -0400
I would like to manage some scheme objects by global variables in C.
That is, I would like to write like this:
global_stack = SCM_EOL;
stack_push (SCM obj)
global_stack = scm_cons (obj, global_stack);
SCM obj = SCM_CAR (global_stack);
global_stack = SCM_CDR (global_stack);
I suppose I have to protect the variable global_stack from GC
by pointer, like:
before using global_stack. Is there any way to do this?
Also, I would like to connect global_stack and a scheme symbol
`global-stack' seamlessly. That is, "global_stack = ...;" in C
changes the value of global-stack, and "(set! global-stack ...)"
in Scheme changes the value of global_stack. I guess I can do
this by modifying the evaluater, as Emacs does, but I wonder if
there is already excellent way to do that.
Thanks in advance.