From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Noah Lavine Newsgroups: gmane.lisp.guile.devel Subject: Re: Trouble using (current-filename) Date: Sun, 19 Feb 2012 16:30:26 -0500 Message-ID: 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> <87linywn7z.fsf@gnu.org> <87zkcezfe6.fsf@pobox.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1329687037 8245 80.91.229.3 (19 Feb 2012 21:30:37 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 19 Feb 2012 21:30:37 +0000 (UTC) Cc: =?ISO-8859-1?Q?Ludovic_Court=E8s?= , guile-devel@gnu.org, Neil Jerram To: Andy Wingo Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Feb 19 22:30:36 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 1RzEL3-0000IM-C4 for guile-devel@m.gmane.org; Sun, 19 Feb 2012 22:30:33 +0100 Original-Received: from localhost ([::1]:34144 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzEL2-0005tN-KB for guile-devel@m.gmane.org; Sun, 19 Feb 2012 16:30:32 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:54673) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzEKz-0005tB-5T for guile-devel@gnu.org; Sun, 19 Feb 2012 16:30:30 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RzEKx-0005R9-VN for guile-devel@gnu.org; Sun, 19 Feb 2012 16:30:29 -0500 Original-Received: from mail-iy0-f169.google.com ([209.85.210.169]:36521) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzEKx-0005R4-Q7; Sun, 19 Feb 2012 16:30:27 -0500 Original-Received: by iagz16 with SMTP id z16so8610431iag.0 for ; Sun, 19 Feb 2012 13:30:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=fADD+ZsQ3NuZyJukvWqvy9IECRO4ih9jbkNu0Dvh5aA=; b=lQs0QbDGM01PjoewYT0pqfaOJbI8QrZhKEBCs9N01fU9Qf45YxB5IsOnVP3xFRWuWE E9uJyyjRpBSTrSMntzCnRkM/gXfKara2W3fF2S+2lf88vbjB+9ku2o+5Z6ztFEJcUwub 0j7WBk2uROgu154W/FiTxM9ANvCNFeI3qEF7o= Original-Received: by 10.50.236.3 with SMTP id uq3mr7360398igc.11.1329687026132; Sun, 19 Feb 2012 13:30:26 -0800 (PST) Original-Received: by 10.42.142.7 with HTTP; Sun, 19 Feb 2012 13:30:26 -0800 (PST) In-Reply-To: <87zkcezfe6.fsf@pobox.com> X-Google-Sender-Auth: PXTdJKlEXaTmjPbBY2Vfa59crh0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.210.169 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:13906 Archived-At: What about having two bits of syntax, current-filename and current-file-path? Or better yet, current-filename and current-file-directory, with the guarantee that (string-append (current-file-directory) path-separator (current-filename)) points to the file when it was compiled? It is more intuitive to me that (current-filename) would return only the file name, with no other path components, and that I would use some other form to get those. Noah On Sun, Feb 19, 2012 at 4:23 PM, Andy Wingo wrote: > On Sun 19 Feb 2012 22:02, ludo@gnu.org (Ludovic Court=E8s) writes: > >>> See Neil's use case here: >>> >>> =A0 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=92s verbose, but it=92s predictable and clearly specified. > > It's terribly verbose, IMO. =A0If we can do something better for those > users, we should. =A0What did you think of my other suggestion about > searching for the file in the load path, and only canonicalizing if it > was not found in the load path? =A0(If it is found in the load path, then > it would be returned in its relative form.) > > Andy > -- > http://wingolog.org/ >