GNU bug report logs - #30657
Add support for file-like objects to the Prosody configuration

Previous Next

Package: guix-patches;

Reported by: Clément Lassieur <clement <at> lassieur.org>

Date: Wed, 28 Feb 2018 22:27:02 UTC

Severity: normal

Done: Clément Lassieur <clement <at> lassieur.org>

Bug is archived. No further changes may be made.

Full log


Message #32 received at 30657 <at> debbugs.gnu.org (full text, mbox):

From: Clément Lassieur <clement <at> lassieur.org>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 30657 <at> debbugs.gnu.org
Subject: Re: [bug#30657] [PATCH 2/4] gexp: Add 'file-like?'.
Date: Sat, 03 Mar 2018 02:44:22 +0100
Ludovic Courtès <ludo <at> gnu.org> 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




This bug report was last modified 7 years and 167 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.