From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.bugs Subject: Re: Guile 1.9: bug in load Date: Thu, 19 Nov 2009 01:29:46 +0100 Message-ID: <87tywre4qt.fsf@gnu.org> References: <4AFDC089.6010101@gnu.org> <4B03C6FD.5060802@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1258590629 1509 80.91.229.12 (19 Nov 2009 00:30:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 19 Nov 2009 00:30:29 +0000 (UTC) To: bug-guile@gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Thu Nov 19 01:30:22 2009 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NAuuk-0004NI-5L for guile-bugs@m.gmane.org; Thu, 19 Nov 2009 01:30:22 +0100 Original-Received: from localhost ([127.0.0.1]:39780 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NAuuj-0000kd-MG for guile-bugs@m.gmane.org; Wed, 18 Nov 2009 19:30:21 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NAuuf-0000kY-QS for bug-guile@gnu.org; Wed, 18 Nov 2009 19:30:17 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NAuua-0000jY-HV for bug-guile@gnu.org; Wed, 18 Nov 2009 19:30:16 -0500 Original-Received: from [199.232.76.173] (port=56488 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NAuua-0000jV-Al for bug-guile@gnu.org; Wed, 18 Nov 2009 19:30:12 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:55029) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NAuuZ-00031v-LV for bug-guile@gnu.org; Wed, 18 Nov 2009 19:30:12 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.50) id 1NAuuY-0004Jb-2C for bug-guile@gnu.org; Thu, 19 Nov 2009 01:30:10 +0100 Original-Received: from reverse-83.fdn.fr ([80.67.176.83]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 19 Nov 2009 01:30:10 +0100 Original-Received: from ludo by reverse-83.fdn.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 19 Nov 2009 01:30:10 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 28 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: reverse-83.fdn.fr X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 29 Brumaire an 218 de la =?iso-8859-1?Q?R=E9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 821D 815D 902A 7EAB 5CEE D120 7FBA 3D4F EB1F 5364 X-OS: x86_64-unknown-linux-gnu User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:p0ksa6C1k2+26CfXGDJ9aghydkM= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:4371 Archived-At: 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’.