chicken-hackers
[Top][All Lists]
Advanced

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

Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path.


From: Jim Ursetto
Subject: Re: [Chicken-hackers] [PATCH 3/4] Remove ##sys#expand-home-path.
Date: Fri, 15 Mar 2013 15:46:35 -0500

On Mar 15, 2013, at 3:35 PM, Peter Bex wrote:

> On Fri, Mar 15, 2013 at 09:30:43PM +0100, Felix wrote:
>> From: Peter Bex <address@hidden>
>>> I agree we can't immediately do it, but we should strive towards a clean,
>>> safe API in the long run.  Just keeping it around is not an option either.
>>> Adding more parameters or options is ugly, IMHO.
>> 
>> But let's not forget convenience...
> 
> I don't think (with-input-from-file (expand-path "~/foo") read) is less
> convenient than (with-input-from-file "~/foo" read expand-path: #t)

I certainly agree with that.

One option may be to create an egg that modifies and exports all the
affected code.  For example:

(define (with-input-from-file str thunk . mode)
 (apply core:with-input-from-file (expand-path str) thunk mode))

And then you can import the module with or without a prefix if you
want automatically-expanding versions.


A second option would be to provide a global boolean parameter
such as (expand-pathnames) which would enable or disable automatic
path expansion.

Jim


reply via email to

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