[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: proposal: with-file-writeable
From: |
Ludovic Courtès |
Subject: |
Re: proposal: with-file-writeable |
Date: |
Thu, 15 Feb 2018 00:28:11 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) |
Gábor Boskovits <address@hidden> skribis:
> the make-file-writeable function seems a bit too imperative to me, it would
> look better if we could have a with-file-writeable function, so that we can
> constrain the size effect, and more. Moreover if a file is read-only to
> start with, it might be a good idea to keep it that way anyways. WDYT?
Now that I found the function in (guix build utils) (thanks for guiding
me!), I see what you mean. ‘make-file-writable’ is imperative, true,
but I’d say that file system operations are imperative in nature.
A ‘with-file-writeable’ form would give a false sense of “containment” I
think. Contrary to what the name suggests, its effect would *not* be
limited to the dynamic extent of its body, in the current thread;
instead, the effect would be globally visible on the system.
Last, the style of (guix build utils) is a lesser concern in a way
because its primary use case is package builds. All this code is
“plumbing” and mostly imperative.
So, all in all, I’d rather keep it this way.
Thoughts?
Ludo’.