GNU bug report logs - #22142
A bug with define-syntax

Previous Next

Package: guile;

Reported by: Tommi Höynälänmaa <tommi.hoynalanmaa <at> gmail.com>

Date: Fri, 11 Dec 2015 17:29:02 UTC

Severity: normal

Done: Mark H Weaver <mhw <at> netris.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 22142 in the body.
You can then email your comments to 22142 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guile <at> gnu.org:
bug#22142; Package guile. (Fri, 11 Dec 2015 17:29:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tommi Höynälänmaa <tommi.hoynalanmaa <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Fri, 11 Dec 2015 17:29:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tommi Höynälänmaa <tommi.hoynalanmaa <at> gmail.com>
To: bug-guile <at> gnu.org
Subject: A bug with define-syntax
Date: Fri, 11 Dec 2015 15:26:14 +0200
[Message part 1 (text/plain, inline)]
 I get the following error message:

--- cut here ---
../../translator/theme-d-compile.scm -m ..  -o hello-world.tcp
hello-world.thp
;;; note: source file /etc/theme-d-config.scm
;;;       newer than compiled
/home/tohoyn/.cache/guile/ccache/2.0-LE-8-2.0/etc/theme-d-config.scm.go
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;;       or pass the --no-auto-compile argument to disable.
;;; compiling /etc/theme-d-config.scm
;;; compiled
/home/tohoyn/.cache/guile/ccache/2.0-LE-8-2.0/etc/theme-d-config.scm.go
Unit compiled successfully.
../../translator/theme-d-link.scm -m ..  -o hello-world.scm hello-world.tcp
Backtrace:
In /usr/local/share/theme-d/translator/theme-d-parametrized-definitions.scm:
 693: 19 [do-bind-type-vars1 #(# # #<procedure alloc-loc (s-name)> ...) ()
...]
 654: 18 [do-bind-type-vars0 #(# # #<procedure alloc-loc (s-name)> ...) ()
...]
 378: 17 [do-bind-type-vars00 #(# # #<procedure alloc-loc (s-name)> ...) ()
...]
In srfi/srfi-1.scm:
 576: 16 [map #<procedure 29bef00 at
/usr/local/share/theme-d/translator/theme-d-parametrized-definitions.scm:381:42
(subexpr)> ...]
In /usr/local/share/theme-d/translator/theme-d-parametrized-definitions.scm:
 383: 15 [#<procedure 29bef00 at
/usr/local/share/theme-d/translator/theme-d-parametrized-definitions.scm:381:42
(subexpr)> #]
 654: 14 [do-bind-type-vars0 #(# # #<procedure alloc-loc (s-name)> ...) ()
...]
 267: 13 [do-bind-type-vars00 #(# # #<procedure alloc-loc (s-name)> ...) ()
...]
3107: 12 [inst-bind-procedure #(# # #<procedure alloc-loc (s-name)> ...) ()
...]
In /usr/local/share/theme-d/translator/theme-d-expression-cloning.scm:
 459: 11 [rebind-local-variables1 # # #]
 417: 10 [rebind-local-variables0 # # # ...]
 319: 9 [rebind-local-variables00 # # # ...]
In srfi/srfi-1.scm:
 576: 8 [map #<procedure 29c5c90 at
/usr/local/share/theme-d/translator/theme-d-expression-cloning.scm:321:36
(subexpr)> ...]
In /usr/local/share/theme-d/translator/theme-d-expression-cloning.scm:
 417: 7 [rebind-local-variables0 # # # ...]
 319: 6 [rebind-local-variables00 # # # ...]
In srfi/srfi-1.scm:
 578: 5 [map #<procedure 29c5900 at
/usr/local/share/theme-d/translator/theme-d-expression-cloning.scm:321:36
(subexpr)> ...]
In /usr/local/share/theme-d/translator/theme-d-expression-cloning.scm:
 417: 4 [rebind-local-variables0 # # # ...]
 330: 3 [rebind-local-variables00 # # # ...]
3401: 2 [clone-with-branches # # # ...]
In /usr/local/share/theme-d/translator/theme-d-expression-rebinding.scm:
  10: 1 [rebind-cond-expression # # # ...]
In unknown file:
   ?: 0 [#<syntax-transformer assert> #t]

ERROR: In procedure #<syntax-transformer assert>:
ERROR: Wrong type to apply: #<syntax-transformer assert>
make: *** [hello-world.scm] Virhe 1
--- cut here ---

The code should compile.

Steps to reproduce the bug:
1. Download
http://www.iki.fi/tohoyn/theme/th-scheme-utilities-1.1.tar.bz2
and
http://www.iki.fi/tohoyn/theme/theme-d-0.9.1.tar.bz2
2. Unpack and install the packages according to the instructions in the
packages.
3. Go to the subdirectory theme-d/theme-d-code/examples and give command
make hello-world.scm

NOTE: Use TH Scheme utilities 1.1 instead of TH Scheme Utilities 1.1x.
Version 1.1x compiles OK.

I have used guile version 2.0.9 in Ubuntu 14.04.

Yours sincerely,

     Tommi Höynälänmaa
[Message part 2 (text/html, inline)]

Information forwarded to bug-guile <at> gnu.org:
bug#22142; Package guile. (Tue, 15 Dec 2015 08:20:01 GMT) Full text and rfc822 format available.

Message #8 received at 22142 <at> debbugs.gnu.org (full text, mbox):

From: Mark H Weaver <mhw <at> netris.org>
To: Tommi Höynälänmaa <tommi.hoynalanmaa <at> gmail.com>
Cc: 22142 <at> debbugs.gnu.org
Subject: Re: bug#22142: A bug with define-syntax
Date: Tue, 15 Dec 2015 03:19:43 -0500
Tommi Höynälänmaa <tommi.hoynalanmaa <at> gmail.com> writes:

> I get the following error message:

[...]

> ERROR: In procedure #<syntax-transformer assert>:
> ERROR: Wrong type to apply: #<syntax-transformer assert>
> make: *** [hello-world.scm] Virhe 1
> --- cut here ---
>
> The code should compile.

This error indicates, roughly speaking, that 'assert' was used before it
was defined.  More precisely: an expression that uses the 'assert' macro
was (macro-)expanded before 'assert' was defined.

This works in Guile 1.x, because it's a pure interpreter that performs
macro expansion lazily, i.e. it delays expansion of a given expression
until the first time the expression is evaluated.  This allows you to
_define_ a procedure that uses 'assert' before 'assert' is defined, as
long as the procedure is not _applied_ (i.e. called) before 'assert' is
defined.

Guile 2.x uses a new macro expander that is far superior in most
respects, but it does not support lazy expansion, and therefore strictly
requires that macros be defined before their uses are expanded.

     Regards,
       Mark




bug closed, send any further explanations to 22142 <at> debbugs.gnu.org and Tommi Höynälänmaa <tommi.hoynalanmaa <at> gmail.com> Request was from Mark H Weaver <mhw <at> netris.org> to control <at> debbugs.gnu.org. (Wed, 06 Jan 2016 21:47:01 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 04 Feb 2016 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 133 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.