From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: joakim@verona.se Newsgroups: gmane.lisp.guile.user Subject: Re: gnome-clutter + repl? Date: Tue, 27 Sep 2011 11:19:31 +0200 Message-ID: References: <87d3ep90pn.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1317157287 20729 80.91.229.12 (27 Sep 2011 21:01:27 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 27 Sep 2011 21:01:27 +0000 (UTC) Cc: guile-user@gnu.org To: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Sep 27 23:01:23 2011 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1R8emI-0004LK-Vz for guile-user@m.gmane.org; Tue, 27 Sep 2011 23:01:23 +0200 Original-Received: from localhost ([::1]:47842 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8emI-00057D-K7 for guile-user@m.gmane.org; Tue, 27 Sep 2011 17:01:22 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:46090) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8TpH-0004pV-1p for guile-user@gnu.org; Tue, 27 Sep 2011 05:19:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R8TpB-0007xY-C3 for guile-user@gnu.org; Tue, 27 Sep 2011 05:19:42 -0400 Original-Received: from iwfs.imcode.com ([82.115.149.64]:36876 helo=gate.verona.se) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8Tp8-0007vH-3q; Tue, 27 Sep 2011 05:19:34 -0400 Original-Received: from chopper.vpn.verona.se (IDENT:1005@localhost [127.0.0.1]) by gate.verona.se (8.13.4/8.11.4) with ESMTP id p8R9JVNa004530; Tue, 27 Sep 2011 11:19:31 +0200 In-Reply-To: <87d3ep90pn.fsf@gnu.org> ("Ludovic \=\?iso-8859-1\?Q\?Court\=E8s\?\= \=\?iso-8859-1\?Q\?\=22's\?\= message of "Sat, 24 Sep 2011 21:53:08 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 82.115.149.64 X-Mailman-Approved-At: Tue, 27 Sep 2011 17:01:18 -0400 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:8838 Archived-At: ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Hi Joakim! > > joakim@verona.se 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=E2=80=99. 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 #: 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");=20=20 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) --=20 Joakim Verona