From: Andy Wingo <wingo@pobox.com>
To: Thien-Thi Nguyen <ttn@gnuvola.org>
Cc: bug-guile@gnu.org
Subject: Re: Guile 1.9: bug in load
Date: Wed, 18 Nov 2009 22:03:19 +0100 [thread overview]
Message-ID: <m3ws1nk0ko.fsf@pobox.com> (raw)
In-Reply-To: <87d43ge7la.fsf@ambire.localdomain> (Thien-Thi Nguyen's message of "Wed, 18 Nov 2009 06:16:01 +0100")
Hi Thien-Thi,
On Wed 18 Nov 2009 06:16, Thien-Thi Nguyen <ttn@gnuvola.org> writes:
> () Andy Wingo <wingo@pobox.com>
> () Mon, 16 Nov 2009 20:23:07 +0100
>
> However the use case is important. We need to implement a (current-file)
> macro, I think, which should allow for file-relative loads.
>
> Is `current-load-port' still around for official Guile?
Yes.
> If so,
>
> (define (current-file)
> (port-filename (current-load-port)))
>
> might be sufficient.
It would probably have to be a macro, as the code that is actually
loaded is bytecode -- the port has been closed already.
This might work:
(define-syntax current-file
(lambda (x)
(syntax-case x ()
((_) (datum->syntax x (and=> (current-load-port) port-filename))))))
But we need the compiler to munge the current load port, which is
currently does not. A bug.
A
--
http://wingolog.org/
next prev parent reply other threads:[~2009-11-18 21:03 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-13 20:24 Guile 1.9: bug in load Luca Saiu
2009-11-16 19:23 ` Andy Wingo
2009-11-18 5:16 ` Thien-Thi Nguyen
2009-11-18 21:03 ` Andy Wingo [this message]
2009-11-19 0:14 ` Ludovic Courtès
2009-11-18 10:05 ` Luca Saiu
2009-11-18 20:57 ` Andy Wingo
2010-03-26 13:02 ` Luca Saiu
2010-07-17 10:59 ` Andy Wingo
2010-07-18 22:54 ` Luca Saiu
2009-11-19 0:29 ` Ludovic Courtès
2009-11-19 22:53 ` Neil Jerram
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=m3ws1nk0ko.fsf@pobox.com \
--to=wingo@pobox.com \
--cc=bug-guile@gnu.org \
--cc=ttn@gnuvola.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).