unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: bug-guile@gnu.org
Subject: Re: Guile 1.9: bug in load
Date: Thu, 19 Nov 2009 01:29:46 +0100	[thread overview]
Message-ID: <87tywre4qt.fsf@gnu.org> (raw)
In-Reply-To: 4B03C6FD.5060802@gnu.org

Hi Luca!

I actually looked into it on my trip back from Göteborg, in the hope of
fixing it for 1.9.5, in vain.  I did reproduce the problem with
‘DIR/a.scm’ and ‘DIR/b/c.scm’ where ‘c.scm’ contains ‘(load "../a.scm")’.

I first tried to fix it by having ‘load’ prepend the directory name of
the file that is calling ‘load’ (hereafter the “loader”) to the path
passed to ‘load’ when it’s a relative path.

To do that, ‘load-compiled’ must be changed to honor
‘current-load-port’, so that we can get the path of the loader in there.
Unfortunately, that doesn’t work: autocompiled files live in a different
place than the corresponding .scm files, so at this point the original
file system context is lost.  Perhaps a different mechanism could be
thought of to propagate the source file path associated with the current
load port.

Another solution would be to special-case calls to ‘load’ at
compile-time to replace its argument by an absolute path.  However,
that’d be inelegant, especially since one could well ‘(set! load foo)’
at run-time.

Yet another solution would be to turn ‘load’ into an expansion-time
thing, but R5RS says it’s a procedure.

Thanks,
Ludo’.





  parent reply	other threads:[~2009-11-19  0:29 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
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 [this message]
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=87tywre4qt.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=bug-guile@gnu.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).