Endless loop in guile 1.6.1 if using macros

2003-01-18 Thread Christian Neukirchen
Hello,

The following program will make guile 1.6.1 enter an endless loop
while garbage collecting.

Put this into `module.scm':

  ;
  (define-module (module)
:use-syntax (ice-9 syncase))
  
  (export f)
  
  (define-syntax ds
(syntax-rules ()
  ((ds a) (string-append a  (by define-syntax)\n
  
  (define (f)
(display In F.\n)
(display (ds In F)))
  ;

And this into `main.scm':

  ;
  (use-modules (module))
  (f)
  ;

If you run this now:

  $ guile -s main.scm
  In F.
   -- Endless loop!

However, if you change the

  (export f)

into
  
  (export f ds)

everything works correctly!

  $ guile -s main.scm
  In F.
  In F (by define-syntax)

Therefore I think, all macros used by exported guile functions have to
get exported too.

This bug seems to appear in guile 1.6 only, since I talked to the mixp
developer, he uses guile 1.7 and can't reproduce it.

If you have patches, could you please CC: them to me?

Happy hacking,
  Christian Neukirchen [EMAIL PROTECTED]


__

Gesendet von Yahoo! Mail - http://mail.yahoo.de
Bis zu 100 MB Speicher bei http://premiummail.yahoo.de


___
Bug-guile mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-guile



Re: Endless loop in guile 1.6.1 if using macros

2003-01-18 Thread Mikael Djurfeldt
Christian Neukirchen [EMAIL PROTECTED] writes:

 Therefore I think, all macros used by exported guile functions have to
 get exported too.

That is correct.  Finally, that won't be necessary, but currently it
is.  This has to do with the fact that the original implementation of
syntax-case macros which Guile uses is not written for use with a
module system.  We have in mind to fix it, but it is not fixed yet.

 This bug seems to appear in guile 1.6 only, since I talked to the mixp
 developer, he uses guile 1.7 and can't reproduce it.

I recently got the syncase module to expand Guile macros as well.  The
effect is that the (ds ...) form in your example is expanded already
at the definition of f.  So while syncase macros are still not fully
integrated with the module system = you *should* always export
bindings inserted by the macro as well, it happens to work in 1.7 in
this particular case.

 If you have patches, could you please CC: them to me?

The development source tree of guile-1.7 is publicly available via the
Guile homepage.  You can use the cvs diff command to obtain patches.

Best regards,
Mikael D.


___
Bug-guile mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-guile