unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Noah Lavine <noah.b.lavine@gmail.com>
To: Andy Wingo <wingo@pobox.com>
Cc: "Ludovic Courtès" <ludo@gnu.org>,
	guile-devel@gnu.org, "Neil Jerram" <neil@ossau.uklinux.net>
Subject: Re: Trouble using (current-filename)
Date: Sun, 19 Feb 2012 16:30:26 -0500	[thread overview]
Message-ID: <CA+U71=NdWqMW7t7kukGYc2_m4yPaAe3LGQM4u9mUCOszikkjjg@mail.gmail.com> (raw)
In-Reply-To: <87zkcezfe6.fsf@pobox.com>

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 <wingo@pobox.com> wrote:
> On Sun 19 Feb 2012 22:02, ludo@gnu.org (Ludovic Courtès) writes:
>
>>> See Neil's use case here:
>>>
>>>   http://thread.gmane.org/gmane.lisp.guile.devel/13440/focus=13621
>>>
>>> Can we do something that makes sense for both cases?
>>
>> Well, (add-to-load-path (dirname (canonicalize-path (current-filename)))) ?
>>
>> Yes it’s verbose, but it’s predictable and clearly specified.
>
> It's terribly verbose, IMO.  If we can do something better for those
> users, we should.  What 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?  (If it is found in the load path, then
> it would be returned in its relative form.)
>
> Andy
> --
> http://wingolog.org/
>



  reply	other threads:[~2012-02-19 21:30 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-14 18:57 Trouble using (current-filename) Mark H Weaver
2012-02-15 22:23 ` Andy Wingo
2012-02-16 21:34   ` Ludovic Courtès
2012-02-16 22:25     ` Andy Wingo
2012-02-17 22:49       ` Ludovic Courtès
2012-02-18 20:58         ` Andy Wingo
2012-02-19 14:10           ` Ludovic Courtès
2012-02-19 20:44             ` Andy Wingo
2012-02-19 21:02               ` Ludovic Courtès
2012-02-19 21:23                 ` Andy Wingo
2012-02-19 21:30                   ` Noah Lavine [this message]
2012-02-20 13:12                     ` Ludovic Courtès
2012-02-21 20:48             ` Neil Jerram
2012-02-21 20:52               ` Ludovic Courtès
2012-02-21 21:00                 ` Neil Jerram
2012-03-15  2:00                   ` Noah Lavine
2012-03-15  8:34                     ` Neil Jerram
2012-03-15 16:41                       ` Ludovic Courtès
2012-03-15 21:31                         ` Andy Wingo
2012-03-21 21:11                           ` Ludovic Courtès
2012-02-21 17:38   ` Mark H Weaver

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CA+U71=NdWqMW7t7kukGYc2_m4yPaAe3LGQM4u9mUCOszikkjjg@mail.gmail.com' \
    --to=noah.b.lavine@gmail.com \
    --cc=guile-devel@gnu.org \
    --cc=ludo@gnu.org \
    --cc=neil@ossau.uklinux.net \
    --cc=wingo@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).