From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: proposal: with-file-writeable Date: Thu, 15 Feb 2018 00:28:11 +0100 Message-ID: <87wozfp2wk.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53793) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1em6TJ-0001Or-9P for guix-devel@gnu.org; Wed, 14 Feb 2018 18:28:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1em6TG-0003It-5x for guix-devel@gnu.org; Wed, 14 Feb 2018 18:28:17 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:46548) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1em6TF-0003IA-Us for guix-devel@gnu.org; Wed, 14 Feb 2018 18:28:14 -0500 In-Reply-To: (=?utf-8?Q?=22G=C3=A1bor?= Boskovits"'s message of "Sat, 10 Feb 2018 22:50:04 +0100") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: =?utf-8?Q?G=C3=A1bor?= Boskovits Cc: Guix-devel G=C3=A1bor Boskovits skribis: > the make-file-writeable function seems a bit too imperative to me, it wou= ld > look better if we could have a with-file-writeable function, so that we c= an > 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. =E2=80=98make-file-writable=E2=80=99 is imperat= ive, true, but I=E2=80=99d say that file system operations are imperative in nature. A =E2=80=98with-file-writeable=E2=80=99 form would give a false sense of = =E2=80=9Ccontainment=E2=80=9D 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 =E2=80=9Cplumbing=E2=80=9D and mostly imperative. So, all in all, I=E2=80=99d rather keep it this way. Thoughts? Ludo=E2=80=99.