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: Re: Trouble using (current-filename) Date: Wed, 15 Feb 2012 23:23:53 +0100 Message-ID: <87zkcjloqu.fsf@pobox.com> References: <87d39h451b.fsf@netris.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1329344655 9202 80.91.229.3 (15 Feb 2012 22:24:15 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 15 Feb 2012 22:24:15 +0000 (UTC) Cc: guile-devel@gnu.org To: Mark H Weaver Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Wed Feb 15 23:24:10 2012 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RxnGi-0000Dy-OV for guile-devel@m.gmane.org; Wed, 15 Feb 2012 23:24:08 +0100 Original-Received: from localhost ([::1]:52191 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RxnGi-0002Tq-8l for guile-devel@m.gmane.org; Wed, 15 Feb 2012 17:24:08 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:41243) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RxnGc-0002Tj-Bk for guile-devel@gnu.org; Wed, 15 Feb 2012 17:24:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RxnGX-0007sS-73 for guile-devel@gnu.org; Wed, 15 Feb 2012 17:24:02 -0500 Original-Received: from a-pb-sasl-sd.pobox.com ([74.115.168.62]:49745 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RxnGX-0007sO-3D for guile-devel@gnu.org; Wed, 15 Feb 2012 17:23:57 -0500 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id CA5FA8E95; Wed, 15 Feb 2012 17:23:56 -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=zSg7ywE0cS6wvjt/CHYHy4/7wGg=; b=bzTX1n S6L3OA0OD2Vwl0xBynY9Azshh7ryqtc/ugbPqJIhy+hOcrHpTCP0367teweTjZiW 5uZQY7LMkrzcqKsde3i5VVJYZJTQ5mwtuo0QOffOB9S1cZERMQydUz+bFJX6jCyK 6TIxUlVphMsdrMXYfu4UMfYqS2ihCkT2zGEDk= 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=CjuN/ls9IPTmqvMbgmmGlC4nokn8g5AS zFvSLzotLXgNw5uqRosbOGZrRpnMx0hdgeHTzmyWRmYgLrT8EGZIB6qnEUVS59Ss yPq2kZc8+rlH1JKEaIagR6NAlHkyoW9y2xaH7+kgU37xVD3Ahc3HCpBK22RSAwDF ft8kOqCMvN0= 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 C3AF78E94; Wed, 15 Feb 2012 17:23:56 -0500 (EST) Original-Received: from badger (unknown [90.164.198.39]) (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 0C8148E92; Wed, 15 Feb 2012 17:23:55 -0500 (EST) In-Reply-To: <87d39h451b.fsf@netris.org> (Mark H. Weaver's message of "Tue, 14 Feb 2012 13:57:04 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) X-Pobox-Relay-ID: BFC08636-5823-11E1-8C9B-65B1DE995924-02397024!a-pb-sasl-sd.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 74.115.168.62 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:13862 Archived-At: Hi Mark :) On Tue 14 Feb 2012 19:57, Mark H Weaver writes: > scheme@(guile-user)> my-filename > $1 = #f I get this result regardless of whether or not the (identity 1 2 3) is there, at least with master; but perhaps that is to be expected, given what you say: > The same thing happens if I remove that line, or if I try with > stable-2.0. > > What am I doing wrong? Nothing, of course :) But, when I annotate current-filename to be like this: (define-syntax current-filename (lambda (x) "A macro that expands to the current filename: the filename that the (current-filename) form appears in. Expands to #f if this information is unavailable." (false-if-exception (pk 'canonicalized (canonicalize-path (pk 'filename (assq-ref (syntax-source x) 'filename))))))) I see that: scheme@(guile-user)> ,use (current-filename-fail) ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0 ;;; or pass the --no-auto-compile argument to disable. ;;; compiling /tmp/current-filename-fail.scm ;;; (filename "current-filename-fail.scm") ;;; compiled /home/wingo/src/guile-master/cache/guile/ccache/2.2-LE-8-3.0/tmp/current-filename-fail.scm.go scheme@(guile-user)> my-filename $1 = #f So we see that the canonicalize-path call failed, as indeed it would. Not sure what the right thing is here. It seems to depend on whether the file is relative to the path or the current working directory. You have any thoughts here? Andy -- http://wingolog.org/