From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Gubinelli Massimiliano Newsgroups: gmane.lisp.guile.user Subject: Re: Problem with modules in Guile 2.0 Date: Fri, 9 Mar 2012 01:03:38 +0100 Message-ID: References: <54183C89-DE93-417E-84EC-5C454E56EE35@gmail.com> <87eht4yww5.fsf@pobox.com> <79B073AF-B3A8-46E0-A047-C4F5686E167E@gmail.com> <87obs7vojn.fsf@netris.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1331251444 16741 80.91.229.3 (9 Mar 2012 00:04:04 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 9 Mar 2012 00:04:04 +0000 (UTC) Cc: guile-user@gnu.org To: Mark H Weaver Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Fri Mar 09 01:04:03 2012 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1S5nJL-0000oG-JC for guile-user@m.gmane.org; Fri, 09 Mar 2012 01:03:55 +0100 Original-Received: from localhost ([::1]:33122 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5nJK-0005m6-VX for guile-user@m.gmane.org; Thu, 08 Mar 2012 19:03:54 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:38843) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5nJD-0005lx-V3 for guile-user@gnu.org; Thu, 08 Mar 2012 19:03:49 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S5nJB-00008M-QH for guile-user@gnu.org; Thu, 08 Mar 2012 19:03:47 -0500 Original-Received: from mail-ww0-f49.google.com ([74.125.82.49]:47353) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5nJB-000073-DM for guile-user@gnu.org; Thu, 08 Mar 2012 19:03:45 -0500 Original-Received: by wgbdr1 with SMTP id dr1so896597wgb.30 for ; Thu, 08 Mar 2012 16:03:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=YQZxsAzh2lEY+GtFuWv/hBokCG1nur0mG/+DOweNJo0=; b=vPLXqMmrxez6fbBmhWuIoJSTGm+rp4lpjUQDt2jO+8wV1IttjPOjZA4MS6NrC+IuA/ rrfWMmjPJtlRnsrNRBBLuG+RCVFznWts10SBgRJO+910X8uIh4muzji3Zjp3bqPS4BHk 6AdKiqNhFTUiJEt2I2zRA+biummDlErq7/ii0LvnsV9qY4TrPnvVAqST+d/4bEM7h+eg 1+maX4/Hwy6tZRDLbvGIqhMzY5n9g4hlx6KbcG4lZJJc8/nVVeRRQ6P/7a0ZKpcWR+/0 rV9oJ57e1G15mEitZv7Z6o64od9hxcrCUoHYAnr3w9g7HJxX+5ZxB71jQ/XHT+w60Pcn Q9uA== Original-Received: by 10.180.82.132 with SMTP id i4mr39466833wiy.12.1331251422041; Thu, 08 Mar 2012 16:03:42 -0800 (PST) Original-Received: from [10.1.10.32] ([196.203.29.245]) by mx.google.com with ESMTPS id 9sm1054672wid.2.2012.03.08.16.03.39 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 08 Mar 2012 16:03:41 -0800 (PST) In-Reply-To: <87obs7vojn.fsf@netris.org> X-Mailer: Apple Mail (2.1257) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 74.125.82.49 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:9332 Archived-At: Hi Mark, thanks again. I start to understand better the Guile 2 compile system. = I decided to dig into boot-9.scm to have a more precise idea of the = ecosystem around my scripts. Unfortunately it seems that the basic = TeXmacs scripting infrastructure need a major change to be run into = Guile 2.0 and I'm afraid not to be sufficiently proficient in scheme to = do this in a short time. Is there anyone on this list which would like = to assist me to port GNU TeXmacs to Guile 2.0. Currently the code in svn = builds fine against 2.0 so the problem is just to adapt the scheme = scripts which rely on a customized module system. If you are interested = you can contact me privately. In the meantime I will dig into the code = hoping to find illumination among parentheses=85. best max On Mar 8, 2012, at 3:01 AM, Mark H Weaver wrote: > Gubinelli Massimiliano writes: >=20 >> Thanks for the prompt reply to both of you. However the proposed >> solution do not work in my case. >=20 > I think it _did_ solve your original problem, but now you have moved = on > to other unrelated problems. >=20 >> After implementing the >> begin-for-syntax alternative I now get >>=20 >> scheme@(guile-user)> (load "main.scm") >> ;;; compiling /Users/mgubi/t/build-64-guile-2.0/test-modules/main.scm >> ;;; note: source file = /Users/mgubi/t/build-64-guile-2.0/test-modules/test-modules.scm >> ;;; newer than compiled >> = /Users/mgubi/.cache/guile/ccache/2.0-LE-8-2.0/Users/mgubi/t/build-64-guile= -2.0/test-modules/test-modules.scm.go >> ;;; compiling = /Users/mgubi/t/build-64-guile-2.0/test-modules/test-modules.scm >> ;;; >> = /Users/mgubi/t/build-64-guile-2.0/test-modules/test-modules.scm:15:34: >> warning: possibly unbound variable `compile-interface-spec' >=20 > Note that 'compile-interface-spec' was an undocumented internal > procedure of Guile 1.x, and no longer exists in Guile 2. >=20 >> ;;; = /Users/mgubi/t/build-64-guile-2.0/test-modules/test-modules.scm:32:11: = warning: possibly unbound variable `:use' >> ;;; = /Users/mgubi/t/build-64-guile-2.0/test-modules/test-modules.scm:33:11: = warning: possibly unbound variable `:inherit' >> ;;; = /Users/mgubi/t/build-64-guile-2.0/test-modules/test-modules.scm:34:11: = warning: possibly unbound variable `:export' >=20 > In order to use the shorter keyword syntax ':use' (instead of = '#:use'), > you must set the prefix keywords reader option. Put the following at > the beginning of your 'begin-for-syntax' form: >=20 > (read-set! keywords 'prefix) >=20 >> ;;; compiled = /Users/mgubi/.cache/guile/ccache/2.0-LE-8-2.0/Users/mgubi/t/build-64-guile= -2.0/test-modules/test-modules.scm.go >> ;;; WARNING: compilation of = /Users/mgubi/t/build-64-guile-2.0/test-modules/main.scm failed: >> ;;; ERROR: No variable named %module-public-interface in # >> ERROR: In procedure scm-error: >> ERROR: No variable named %module-public-interface in # >>=20 >> Entering a new prompt. Type `,bt' for a backtrace or `,q' to = continue. >> scheme@(guile-user) [1]>=20 >>=20 >> if I understand correctly this backtrace it seems that the module is >> not completely loaded at compile time and there is not public >> interface available. How can I force the evaluation of the loaded >> modules in order to get a list of exported symbols? >=20 > I cannot reproduce this. When I try using your example code, Guile > 2.0.5 tries to compile (sub mymodule). Are you sure that you = remembered > to set GUILE_LOAD_PATH during this test run? >=20 > This is what I see: >=20 > GNU Guile 2.0.5 > Copyright (C) 1995-2012 Free Software Foundation, Inc. >=20 > Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. > This program is free software, and you are welcome to redistribute it > under certain conditions; type `,show c' for details. >=20 > Enter `,help' for help. > scheme@(guile-user)> (load "main.scm") > ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=3D0 > ;;; or pass the --no-auto-compile argument to disable. > ;;; compiling /home/mhw/guile-modules/main.scm > ;;; compiling /home/mhw/guile-modules/./test-modules.scm > ;;; test-modules.scm:15:34: warning: possibly unbound variable = `compile-interface-spec' > ;;; compiled = /home/mhw/.cache/guile/ccache/2.0-LE-4-2.0/home/mhw/guile-modules/test-mod= ules.scm.go > ;;; compiling /home/mhw/guile-modules/sub/mymodule.scm > ;;; sub/mymodule.scm:1:0: warning: possibly unbound variable = `texmacs-module' > ;;; sub/mymodule.scm:1:16: warning: possibly unbound variable `sub' > ;;; sub/mymodule.scm:1:16: warning: possibly unbound variable = `mymodule' > ;;; compiled = /home/mhw/.cache/guile/ccache/2.0-LE-4-2.0/home/mhw/guile-modules/sub/mymo= dule.scm.go > ;;; WARNING: compilation of /home/mhw/guile-modules/main.scm failed: > ;;; ERROR: In procedure module-lookup: Unbound variable: = texmacs-module > sub/mymodule.scm:1:0: In procedure #: > sub/mymodule.scm:1:0: In procedure module-lookup: Unbound variable: = texmacs-module >=20 > Entering a new prompt. Type `,bt' for a backtrace or `,q' to = continue. > scheme@(#{ g435}#) [1]>=20 >=20 > and the problem here is that the compilation of sub/mymodule.scm fails > because the 'texmacs-module' macro was used before it was imported = into > that module. Initially, a module imports only the (guile) module. If > you want to use a non-standard module declaration like = 'texmacs-module' > at the top of a module, you'll need to add that binding to the (guile) > module. >=20 > Best, > Mark