From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: file names embedded in .go Date: Mon, 19 Apr 2010 16:52:09 +0200 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1271688873 1284 80.91.229.12 (19 Apr 2010 14:54:33 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 19 Apr 2010 14:54:33 +0000 (UTC) To: guile-devel Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Apr 19 16:54:29 2010 connect(): No such file or directory Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O3sMm-0005mF-Ti for guile-devel@m.gmane.org; Mon, 19 Apr 2010 16:54:29 +0200 Original-Received: from localhost ([127.0.0.1]:36012 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O3sMm-0004qT-5c for guile-devel@m.gmane.org; Mon, 19 Apr 2010 10:54:28 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O3sJy-0003ey-6w for guile-devel@gnu.org; Mon, 19 Apr 2010 10:51:34 -0400 Original-Received: from [140.186.70.92] (port=36419 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O3sJv-0003db-Lv for guile-devel@gnu.org; Mon, 19 Apr 2010 10:51:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O3sJt-0006b0-Lm for guile-devel@gnu.org; Mon, 19 Apr 2010 10:51:31 -0400 Original-Received: from a-pb-sasl-quonix.pobox.com ([208.72.237.25]:58945 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O3sJt-0006MU-J5 for guile-devel@gnu.org; Mon, 19 Apr 2010 10:51:29 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 8B689AC13A for ; Mon, 19 Apr 2010 10:50:42 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to :subject:date:message-id:mime-version:content-type; s=sasl; bh=t SWNGxlOaoK6cclOzDh0YH9F980=; b=v4O1U/o2jHABnsBjlvZtJgIUNM+eAl1H3 TEHeXFs32m1aWymGuXdF6Lo8QJE1bxIWpZN/7snQqBufnDnKWsvxjE8jNugzD0Jc Rh/pz+bZXPOuAZ6n/VfRG/Sx5U+llE3WtBlMRLw/xk+gWs2Hpn2VVQiWsKXU2Ydj 6L76tsNFYk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:subject :date:message-id:mime-version:content-type; q=dns; s=sasl; b=tde GlQskv2HHywIuC1+2M/ecWpoNC6Gm+QjxEiJehIE84NuS42+Pd5P4NJntZAZo+QK QB2YK/AEK4AC5493nf4t+9Ttk/4O977nddawvuDrra9cx7cuiGA3iB2zcZEiQ5NH yTJkfadZMW00jvwokvIZpHhy1GGGk4NTP0E4cEhU= Original-Received: from a-pb-sasl-quonix. (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 8747BAC139 for ; Mon, 19 Apr 2010 10:50:42 -0400 (EDT) Original-Received: from unquote (unknown [83.202.100.241]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTPSA id 01518AC138 for ; Mon, 19 Apr 2010 10:50:41 -0400 (EDT) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux) X-Pobox-Relay-ID: ED86115E-4BC2-11DF-B7CF-D033EE7EF46B-02397024!a-pb-sasl-quonix.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:10260 Archived-At: Hey all, I recently added a global fluid, %file-port-name-canonicalization, which defaults to #f. But if it's 'absolute, the port name of a file port will be canonicalized to the absolute path; or, if it's 'relative, the port name is the canonical name of the file, relative to the %load-path, or the file name as given otherwise. The intention was to allow the user to control (port-filename P), so that the user could find e.g. the absolute path corresponding to that port at the time that it was made. The 'relative mode is particularly useful, because it's the `port-filename' that gets embedded in a .go file. Oftentimes you would want to be able to map a .go file to a corresponding .scm, and currently it's difficult. For example if you compile in a +build subdirectory of Guile via `../configure', then the `port-filename' is e.g. "../../module/ice-9/boot-9.scm", which doesn't make any sense. One could instead embed the absolute path, but then you have the problem that you might remove your build or source directory; it doesn't make sense to have installed files pointing to build paths. DWARF does this, but only because with C you don't install the source, but with Guile you should. So for me the right thing to do, by default, is to embed a path relative to the `%load-path', so that one can find the source file via something like: (use-modules (system vm program)) (define (program-source-file p) (search-path %load-path (source:file (program-source p 0)))) I added a keyword argument to compile-file and compile-and-load for this purpose, to parameterize %file-port-name-canonicalization during the extent of the given file's compilation. So now files compiled with guile-tools compile will have their relative path embedded in them, so that we can map .go files to .scm files, whether installed or uninstalled. Thoughts? Andy -- http://wingolog.org/