[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gnome-clutter + repl?
From: |
joakim |
Subject: |
Re: gnome-clutter + repl? |
Date: |
Tue, 27 Sep 2011 11:19:31 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
address@hidden (Ludovic Courtès) writes:
> Hi Joakim!
>
> address@hidden skribis:
>
>> Anyway, the problem is that clutter needs its own event loop,
>> clutter-main, so then I can't simply use the Guile REPL as I'd like.
>
> Maybe you could start a REPL server? (See the (system repl server)
> module.)
>
> You could then use Geiser to connect to it (M-x geiser-connect), which
> should allow you to get a nice development environment.
>
> Hope this helps,
> Ludo’.
Okay this approach started out nicely!
The C code boots both Guile and Clutter in the same thread(I think).
I can access the REPL port with nc. Thus, bliss and happiness so far!
However. Unevitable this happy narrative is disturbed by problems.
I am unable to export a C function to Guile. I've tried snarfing and a
more primitive approach as well. The C function doesn't wind up
available in the REPL. All I get is:
nc localhost 37146
...
(myloadfromdata "")
;;; socket:9:17: warning: possibly unbound variable `myloadfromdata'
socket:9:17: In procedure #<procedure b51600 at socket:9:17 ()>:
socket:9:17: In procedure module-lookup: Unbound variable: myloadfromdata
The only difference I can think of as compared to the documentation is
that inner main looks like this at the moment:
static void
inner_main (void *closure, int argc, char **argv)
{
scm_c_define_gsubr ("myloadfromdata", 1, 0, 0, myloadfromdata);
printf("starting guile server\n");
scm_c_primitive_load("init.scm");
printf("starting clutter\n");
main_view(argc, argv);
}
If I instead use scm_shell (argc, argv); rather than
scm_c_primitive_load("init.scm"); the function is accessible,
so maybe there is some namespace issue?
init.scm looks like:
(define-module (mytest)
#:use-module (system repl server))
(spawn-server)
--
Joakim Verona