From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40116) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1erwEV-0002nE-23 for guix-patches@gnu.org; Fri, 02 Mar 2018 20:45:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1erwEQ-0007Hr-71 for guix-patches@gnu.org; Fri, 02 Mar 2018 20:45:07 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:33807) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1erwEQ-0007Hn-4E for guix-patches@gnu.org; Fri, 02 Mar 2018 20:45:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1erwEP-00009L-UM for guix-patches@gnu.org; Fri, 02 Mar 2018 20:45:01 -0500 Subject: [bug#30657] [PATCH 2/4] gexp: Add 'file-like?'. Resent-Message-ID: References: <20180228222821.6195-1-clement@lassieur.org> <20180228222821.6195-2-clement@lassieur.org> <87sh9ictft.fsf@gnu.org> From: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur In-reply-to: <87sh9ictft.fsf@gnu.org> Date: Sat, 03 Mar 2018 02:44:22 +0100 Message-ID: <874llylyq1.fsf@lassieur.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 30657@debbugs.gnu.org Ludovic Courtès writes: >> +(define (file-like? object) >> + (or (local-file? object) >> + (plain-file? object) >> + (computed-file? object) >> + (program-file? object) >> + (scheme-file? object) >> + (file-append? object))) > > This procedure would miss new types added with ‘define-gexp-compiler’. > > In fact I think you can simply write: > > (define file-like? (@@ (guix gexp) lookup-compiler)) > > Does that make sense? Yes it's great! One also needs to check that it's a struct though. I put it in (gnu services configuration). Would it make sense to add the 'struct?' check in (guix gexp), or to add 'file-like?' there? Clément