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: Sun, 19 Feb 2012 22:02:40 +0100 Message-ID: <87linywn7z.fsf@gnu.org> References: <87d39h451b.fsf@netris.org> <87zkcjloqu.fsf@pobox.com> <871upu5unw.fsf@gnu.org> <878vk2pgaf.fsf@pobox.com> <87wr7l13eh.fsf@gnu.org> <87y5rz26zz.fsf@pobox.com> <87fwe6ykw2.fsf@gnu.org> <87liny1rjo.fsf@pobox.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1329685370 29277 80.91.229.3 (19 Feb 2012 21:02:50 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 19 Feb 2012 21:02:50 +0000 (UTC) Cc: Neil Jerram , guile-devel@gnu.org To: Andy Wingo Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Feb 19 22:02:50 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 1RzDuC-0000hM-Le for guile-devel@m.gmane.org; Sun, 19 Feb 2012 22:02:48 +0100 Original-Received: from localhost ([::1]:42684 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzDuC-0006Tt-7T for guile-devel@m.gmane.org; Sun, 19 Feb 2012 16:02:48 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:41521) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzDu8-0006Tm-Mm for guile-devel@gnu.org; Sun, 19 Feb 2012 16:02:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RzDu7-0008S3-An for guile-devel@gnu.org; Sun, 19 Feb 2012 16:02:44 -0500 Original-Received: from xanadu.aquilenet.fr ([88.191.123.111]:49523) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzDu7-0008Rz-6B for guile-devel@gnu.org; Sun, 19 Feb 2012 16:02:43 -0500 Original-Received: from localhost (xanadu.aquilenet.fr [127.0.0.1]) by xanadu.aquilenet.fr (Postfix) with ESMTP id 1BE196FBA; Sun, 19 Feb 2012 22:02:42 +0100 (CET) Original-Received: from xanadu.aquilenet.fr ([127.0.0.1]) by localhost (xanadu.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Xv2MhJXOH9t1; Sun, 19 Feb 2012 22:02:42 +0100 (CET) Original-Received: from pluto (reverse-83.fdn.fr [80.67.176.83]) by xanadu.aquilenet.fr (Postfix) with ESMTPSA id 0EF976FB9; Sun, 19 Feb 2012 22:02:40 +0100 (CET) X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 1 =?iso-8859-1?Q?Vent=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 In-Reply-To: <87liny1rjo.fsf@pobox.com> (Andy Wingo's message of "Sun, 19 Feb 2012 21:44:59 +0100") User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.93 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 88.191.123.111 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:13900 Archived-At: Hello! Andy Wingo skribis: > On Sun 19 Feb 2012 15:10, ludo@gnu.org (Ludovic Court=C3=A8s) writes: > >> Andy Wingo skribis: >> >>> On Fri 17 Feb 2012 23:49, ludo@gnu.org (Ludovic Court=C3=A8s) writes: >>> >>>> Would it work to let the user call it themself if needed, like: >>>> >>>> (add-to-load-path (dirname (canonicalize-path (current-filename)))) >>> >>> I would rather have current-filename do a >>> >>> (or (false-if-exception (canonicalize-path p)) p) >>> >>> Current-filename sounds like it should do the right thing, if possible. >> >> I think it=E2=80=99s often undesirable. >> >> Suppose you want to use =E2=80=98current-filename=E2=80=99 in an =E2=80= =98assert=E2=80=99 macro, for >> instance: what you want is a hint, not an absolute path, since that path >> is likely to be invalid at the time you see it (for instance, it could >> point to the source tree on a build machine of your distro.) >> >> Furthermore, including absolute paths by default makes builds >> non-deterministic: two users would get different binaries, just because >> they built things under a different directory. >> >> Thus, I=E2=80=99d rather let users call =E2=80=98canonicalize-path=E2=80= =99 when they know what >> they=E2=80=99re doing, and know that they actually need it. >> >> WDYT? > > I'm fine with that, but I think you are concerned more about code in > modules (compiled in one location, installed and run from another) than > for local scripts. Yes. > See Neil's use case here: > > http://thread.gmane.org/gmane.lisp.guile.devel/13440/focus=3D13621 > > Can we do something that makes sense for both cases? Well, (add-to-load-path (dirname (canonicalize-path (current-filename)))) ? Yes it=E2=80=99s verbose, but it=E2=80=99s predictable and clearly specifie= d. Ludo=E2=80=99.