guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Trouble using (current-filename)


From: Ludovic Courtès
Subject: Re: Trouble using (current-filename)
Date: Sun, 19 Feb 2012 15:10:05 +0100
User-agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.93 (gnu/linux)

Hi,

Andy Wingo <address@hidden> skribis:

> On Fri 17 Feb 2012 23:49, address@hidden (Ludovic Courtès) 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’s often undesirable.

Suppose you want to use ‘current-filename’ in an ‘assert’ 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’d rather let users call ‘canonicalize-path’ when they know what
they’re doing, and know that they actually need it.

WDYT?

Thanks,
Ludo’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]