« Return to Thread: Problem with modules in Guile 2.0

Re: Problem with modules in Guile 2.0

by Massimiliano Gubinelli :: Rate this Message:

| View in Thread

Thanks for the prompt reply to both of you. However the proposed solution do not work in my case. After implementing the begin-for-syntax alternative I now get

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'
;;; /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'
;;; 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 #<directory (sub mymodule) 10507ed80>
ERROR: In procedure scm-error:
ERROR: No variable named %module-public-interface in #<directory (sub mymodule) 10507ed80>

Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.
scheme@(guile-user) [1]>

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?

Best
massimiliano




On Mar 7, 2012, at 9:32 PM, Andy Wingo wrote:

> Hi!
>
> Mark gave great answers; I just wanted to give one more option:
>
> On Tue 06 Mar 2012 22:48, Gubinelli Massimiliano <m.gubinelli@...> writes:
>
>> (load "test-modules.scm")
>
> Add a definition first:
>
>  (cond-expand
>   (guile-2
>    (define-syntax-rule (begin-for-syntax form ...)
>      (eval-when (load compile eval) (begin form ...))))
>   (else
>    (define begin-for-syntax begin)))
>
> Then:
>
>  (begin-for-syntax
>   (load "test-modules.scm"))
>
> Regards,
>
> Andy
> --
> http://wingolog.org/

On Mar 7, 2012, at 9:32 PM, Andy Wingo wrote:

> Hi!
>
> Mark gave great answers; I just wanted to give one more option:
>
> On Tue 06 Mar 2012 22:48, Gubinelli Massimiliano <m.gubinelli@...> writes:
>
>> (load "test-modules.scm")
>
> Add a definition first:
>
>  (cond-expand
>   (guile-2
>    (define-syntax-rule (begin-for-syntax form ...)
>      (eval-when (load compile eval) (begin form ...))))
>   (else
>    (define begin-for-syntax begin)))
>
> Then:
>
>  (begin-for-syntax
>   (load "test-modules.scm"))
>
> Regards,
>
> Andy
> --
> http://wingolog.org/


 « Return to Thread: Problem with modules in Guile 2.0