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: felix . winkelmann
Subject: Re: absolute pathname a.k.a. realpath
Date: Tue, 25 Oct 2022 11:52:39 +0200

> 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.

Does (make-absolute-pathname #f ...) make any sense with the currently
implemented behaviour? It seems to me that this case could handle the
operation as requested by sandra.


felix




reply via email to

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