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.devel Subject: Re: Trouble using (current-filename) Date: Thu, 16 Feb 2012 22:34:59 +0100 Message-ID: <871upu5unw.fsf@gnu.org> References: <87d39h451b.fsf@netris.org> <87zkcjloqu.fsf@pobox.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1329428412 30429 80.91.229.3 (16 Feb 2012 21:40:12 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 16 Feb 2012 21:40:12 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Feb 16 22:40:11 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 1Ry93i-0001uU-Uy for guile-devel@m.gmane.org; Thu, 16 Feb 2012 22:40:11 +0100 Original-Received: from localhost ([::1]:34611 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ry93i-00043q-Aw for guile-devel@m.gmane.org; Thu, 16 Feb 2012 16:40:10 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:39936) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ry93f-00042n-Kn for guile-devel@gnu.org; Thu, 16 Feb 2012 16:40:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ry93d-0005NM-Uq for guile-devel@gnu.org; Thu, 16 Feb 2012 16:40:07 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:50586) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ry93d-0005Mh-Jd for guile-devel@gnu.org; Thu, 16 Feb 2012 16:40:05 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Ry93b-0001rc-Tg for guile-devel@gnu.org; Thu, 16 Feb 2012 22:40:03 +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, 16 Feb 2012 22:40:03 +0100 Original-Received: from ludo by reverse-83.fdn.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 16 Feb 2012 22:40:03 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 18 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: reverse-83.fdn.fr X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 28 =?iso-8859-1?Q?Pluvi=F4se?= an 220 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: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.93 (gnu/linux) Cancel-Lock: sha1:OOZo48rxa2fm9rq5rgfXlaD+lzA= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:13876 Archived-At: Andy Wingo skribis: > (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))))))) What about not canonicalizing the file name? After all, C’s __FILE__ isn’t canonicalized in any way, and canonicalization is sometimes undesirable (you don’t necessarily want to dump the absolute path of a temporary source directory in binaries.) Thanks, Ludo’.