From: Mark H Weaver <mhw@netris.org>
To: rixed@happyleptic.org
Cc: guile-user@gnu.org
Subject: Re: Is this a bug?
Date: Mon, 22 Aug 2011 18:47:37 -0400 [thread overview]
Message-ID: <87ipppcbcm.fsf@yeeloong.netris.org> (raw)
In-Reply-To: <20110816123610.GA8991@ccellier.rd.securactive.lan> (rixed@happyleptic.org's message of "Tue, 16 Aug 2011 14:36:11 +0200")
rixed@happyleptic.org wrote:
> ---[ woe.scm ]---
>
> (define-syntax without-exception
> (syntax-rules ()
> ((without-exception key thunk ...)
> (catch key (lambda () thunk ...)
> (lambda (a . r) #f)))))
>
> ---[ test.scm ]---
>
> (load "woe.scm")
> (without-exception #t (display "toto\n"))
>
> ---[ EOF ]---
[...]
> /home/rixed/src/sact.junkie/test.scm:2:0: In procedure #<procedure 19cc700 ()>:
> /home/rixed/src/sact.junkie/test.scm:2:0: Wrong type to apply: #<syntax-transformer without-exception>
>
> This code used to work on guile 1.8, so what's wrong with it?
The problem is that the compiler, while compiling test.scm, sees no
syntax declaration of `without-exception', and therefore assumes that
`without-exception' is simply a top-level variable.
A simple workaround is to use `(include "woe.scm")'. I don't know the
full details, but my understanding is that unlike `load', `include'
causes the compiler to look for syntax declarations in the included
file.
Another solution (though guile-specific) is to make woe.scm a guile
module, and to use `use-modules' to import it.
Best,
Mark
next prev parent reply other threads:[~2011-08-22 22:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-16 12:36 Is this a bug? rixed
2011-08-22 22:47 ` Mark H Weaver [this message]
2011-08-29 11:27 ` rixed
2011-08-30 16:45 ` Mark H Weaver
2011-08-30 17:21 ` rixed
2011-08-30 17:24 ` Ian Price
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ipppcbcm.fsf@yeeloong.netris.org \
--to=mhw@netris.org \
--cc=guile-user@gnu.org \
--cc=rixed@happyleptic.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).