unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Justin Veilleux <terramorpha@cock.li>
To: guix-devel@gnu.org
Subject: Getting the name of file-like objects
Date: Fri, 1 Apr 2022 16:29:56 -0400	[thread overview]
Message-ID: <e581a026-dad8-3a04-dde0-9b2e35a3042f@cock.li> (raw)

[-- Attachment #1: Type: text/plain, Size: 779 bytes --]

Hi everyone. I'm currently writing a set of helper functions (usually 
written using `computed-file`  which act on file like objects to 
transform them in some way.
For instance, I have a `decompress` function which, given a file-like 
object pointing to an archive, will return a computed file object which 
it will decompress to it's output.
Everything works very well, but I would like to be able to name the 
`computed-file` objects something meaningfull.

```
(define (unzip f)
   (computed-file (string-append (name f) "-unzipped")
     #~(begin
         (system* (string-append #$unzip "/bin/unzip")
                  "-d" #$output
                  #$file))
          #$out))
```

Is there someting which ressembles the imaginary `name` function I used 
above?

Cheers.

[-- Attachment #2: Type: text/html, Size: 988 bytes --]

             reply	other threads:[~2022-04-01 22:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-01 20:29 Justin Veilleux [this message]
2022-04-02  8:32 ` Getting the name of file-like objects Maxime Devos
2022-04-05 12:26   ` Ludovic Courtès
2022-04-02 20:03 ` Liliana Marie Prikler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e581a026-dad8-3a04-dde0-9b2e35a3042f@cock.li \
    --to=terramorpha@cock.li \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).