From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Neil Jerram Newsgroups: gmane.lisp.guile.devel Subject: Re: Trouble using (current-filename) Date: Tue, 21 Feb 2012 21:00:16 +0000 Message-ID: <871upndhr3.fsf@neil-laptop.ossau.uklinux.net> 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> <87aa4bdi9y.fsf@neil-laptop.ossau.uklinux.net> <87fwe3ewnu.fsf@gnu.org> 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 1329858047 23187 80.91.229.3 (21 Feb 2012 21:00:47 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 21 Feb 2012 21:00:47 +0000 (UTC) Cc: Andy Wingo , guile-devel@gnu.org To: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Feb 21 22:00:46 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 1RzwpE-0004gb-6s for guile-devel@m.gmane.org; Tue, 21 Feb 2012 22:00:40 +0100 Original-Received: from localhost ([::1]:38733 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzwpD-0000bD-Ck for guile-devel@m.gmane.org; Tue, 21 Feb 2012 16:00:39 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:43386) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rzwp7-0000aw-2J for guile-devel@gnu.org; Tue, 21 Feb 2012 16:00:37 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rzwp1-0006mP-KQ for guile-devel@gnu.org; Tue, 21 Feb 2012 16:00:32 -0500 Original-Received: from out1.ip07ir2.opaltelecom.net ([62.24.128.243]:29377) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rzwp1-0006m0-E5; Tue, 21 Feb 2012 16:00:27 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EAKwFRE9OlcyG/2dsb2JhbABDhROtLoEIgXMBAQQBIzMjBQsIAxoCBSECAg8BBCU3G4dlA6YLkjqBL4pTIwUWAQkCEwMDAoNfAgE4giiBFgSoJQ X-IronPort-AV: E=Sophos;i="4.73,459,1325462400"; d="scan'208";a="25095254" Original-Received: from host-78-149-204-134.as13285.net (HELO arudy) ([78.149.204.134]) by out1.ip07ir2.opaltelecom.net with ESMTP; 21 Feb 2012 21:00:17 +0000 Original-Received: from neil-laptop.ossau.uklinux.net.ossau.homelinux.net (host-78-149-204-134.as13285.net [78.149.204.134]) by arudy (Postfix) with ESMTPA id 8D10338037; Tue, 21 Feb 2012 21:00:16 +0000 (GMT) In-Reply-To: <87fwe3ewnu.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Tue, 21 Feb 2012 21:52:53 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 62.24.128.243 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:13919 Archived-At: ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Hi Neil! > > Neil Jerram skribis: > >> Perhaps after all the right thing, for my use case, is something based >> on (car (command-line)) and (getcwd). I currently have this >> 'compatibility definition' for Guile 1.8.x: >> >> (define (current-filename) >> (let* ((script (car (command-line))) >> (scriptdir (dirname script)) >> (absdir (cond ((string=3D? scriptdir ".") >> (getcwd)) >> ((string-match "^/" scriptdir) >> scriptdir) >> (else >> (in-vicinity (getcwd) scriptdir))))) >> (in-vicinity scriptdir (basename script)))) >> >> But maybe that's the better solution for 2.x as well. > > Yes, for that case, you definitely want something that happens at > run-time, pretty much like $ORIGIN in ELF files. OK thanks. I think that means you can disregard my use case when considering the future of 'current-filename', then. Neil