guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

modules & syncase


From: Jacques A. Vidrine
Subject: modules & syncase
Date: Mon, 21 May 2001 15:46:14 -0500
User-agent: Mutt/1.2.5i

Hello,

I'm having  a problem using  Guile's module  system to export  a macro
defined using define-syntax.

In the simple case, it works fine, e.g.:

  ;; +----
  ;; | File "example/test1.scm"
  (define-module (example test1)
    :use-module (ice-9 syncase))
  (define-syntax silly
    (syntax-rules ()
      ((silly statements ...)
       (let () statements ...))))
  (export silly)


  ;; +----
  ;; | File "invoke1.scm"
  (use-modules (example test1))
  (silly (display "A-OK\n"))

The above works as expected.  However, given a case where the macro is
defined in one  module, and then used by another  module, Guile hangs.
e.g.:

  ;; +----
  ;; | File "example/test1.scm"
  ;; exactly as before


  ;; +----
  ;; | File "example/test2.scm"
  (define-module (example test2)
    :use-module (example test1))
  (define silly-test
    (lambda ()
      (silly (display "A-OK\n"))))
  (export silly-test)


  ;; +----
  ;; | File "invoke2.scm"
  (use-modules (example test2))
  (silly-test)

When    `invoke2.scm'   is    run,    Guile   hangs    in   a    tight
loop.    A   ktrace   indicates   that  it   is   repeatedly   calling
getrusage/gettimeofday/sigprocmask.

If `invoke2.scm' is altered to import the module that exports the
macro, then the program runs correctly.  i.e.

  ;; +----
  ;; | File "invoke3.scm"
  (use-modules (example test1) (example test2))
  (silly-test)

Am I missing a detail to do with (ice-9 syncase)?

This is Guile 1.4 on FreeBSD 4.3.  The same behavior is observed with
Guile from CVS.

Cheers,
-- 
Jacques Vidrine / address@hidden / address@hidden / address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]