chicken-hackers
[Top][All Lists]
Advanced

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

Re: absolute pathname a.k.a. realpath


From: Evan Hanson
Subject: Re: absolute pathname a.k.a. realpath
Date: Sun, 23 Oct 2022 18:00:38 +1300

On 2022-08-18 10:23, Sandra Snan wrote:
> Would you please add something like this to the pathname module?
>
> (define (absolute-pathname name)
>   (normalize-pathname
>    (if (absolute-pathname? name) name
>        (make-absolute-pathname (current-directory) name))))
>
> Whatever you wanna call it, I'm not married to the name.

FWIW this appears in almost all the programs I write, too, so I'd also
like to see it added.

I think rather than adding something new to core, the ideal would be for
the existing `make-absolute-pathname` procedure to do this when the
first argument is #f. That one is kind of squatting on the optimal name
and seems like the right place for this. But, that's
backwards-incompatible, so isn't really possible in the 5.x release
series.

Maybe `make-absolute-pathname` could accept one, two or three arguments.
When there's one, it's `file`, we get this behaviour you want. When two
or more, it's `dirs` and `file` and the behaviour stays the same.
Curious to know what others think.

Evan



reply via email to

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