From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.bugs Subject: Re: Guile 1.9: bug in load Date: Wed, 18 Nov 2009 22:03:19 +0100 Message-ID: References: <4AFDC089.6010101@gnu.org> <87d43ge7la.fsf@ambire.localdomain> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1258578201 29119 80.91.229.12 (18 Nov 2009 21:03:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 18 Nov 2009 21:03:21 +0000 (UTC) Cc: bug-guile@gnu.org To: Thien-Thi Nguyen Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Wed Nov 18 22:03:13 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 1NArgH-0004Oo-75 for guile-bugs@m.gmane.org; Wed, 18 Nov 2009 22:03:13 +0100 Original-Received: from localhost ([127.0.0.1]:40082 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NArgG-0000v8-OU for guile-bugs@m.gmane.org; Wed, 18 Nov 2009 16:03:12 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NArgC-0000us-Dk for bug-guile@gnu.org; Wed, 18 Nov 2009 16:03:08 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NArg8-0000uM-4M for bug-guile@gnu.org; Wed, 18 Nov 2009 16:03:08 -0500 Original-Received: from [199.232.76.173] (port=42092 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NArg7-0000uJ-UW for bug-guile@gnu.org; Wed, 18 Nov 2009 16:03:03 -0500 Original-Received: from a-pb-sasl-sd.pobox.com ([64.74.157.62]:59964 helo=sasl.smtp.pobox.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NArg7-0002oe-C0 for bug-guile@gnu.org; Wed, 18 Nov 2009 16:03:03 -0500 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 0DD8E9F1A2; Wed, 18 Nov 2009 16:03:03 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=+0rzMTyz5PmasaWn+OGFGHITfeA=; b=FsNL2z 5Ml3kz3jaBtBvAcyv9uikWTN1UsOIBol4LgmBY6FB3B46I0eU26TrUzBwQ+x+Ehr CDBfskMDZ2UfNsw/iTvZRCi7rNG79XRZ2y2/HtHv19Asj+aryumUga4cDm9Lw9cN /aD3Q4qIbqe75K8l6Rqn53+qyW3sg5Y9On9sA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=OU5N9dHck5OPQHxuYCKHHunTwRQyDHQg DOr3gRhAtBgQeWpwtftpGsRoSvT9VmscLnLZxpH9cBXg5kIy9DCq1U8rQo+md33c ZuEICaYin1Gip/ZyObW5roLUloQvU3q+3gzLLp0k4TqiZlK7eeU/TDNlLHHB9bqO NqltHMXG54w= Original-Received: from a-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id EEA569F1A1; Wed, 18 Nov 2009 16:03:01 -0500 (EST) Original-Received: from unquote (unknown [79.156.144.199]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id 2DCC09F1A0; Wed, 18 Nov 2009 16:02:59 -0500 (EST) In-Reply-To: <87d43ge7la.fsf@ambire.localdomain> (Thien-Thi Nguyen's message of "Wed, 18 Nov 2009 06:16:01 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux) X-Pobox-Relay-ID: C2114246-D485-11DE-8F56-EF34BBB5EC2E-02397024!a-pb-sasl-sd.pobox.com X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (beta) 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:4368 Archived-At: Hi Thien-Thi, On Wed 18 Nov 2009 06:16, Thien-Thi Nguyen writes: > () Andy Wingo > () 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/