unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Liliana Marie Prikler <liliana.prikler@gmail.com>
To: Justin Veilleux <terramorpha@cock.li>, guix-devel@gnu.org
Subject: Re: Getting the name of file-like objects
Date: Sat, 02 Apr 2022 22:03:53 +0200	[thread overview]
Message-ID: <689e67dd833b3ab08fc8cd16706f82b989e46b2c.camel@gmail.com> (raw)
In-Reply-To: <e581a026-dad8-3a04-dde0-9b2e35a3042f@cock.li>

Hi Justin

Am Freitag, dem 01.04.2022 um 16:29 -0400 schrieb Justin Veilleux:
>  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?
Generally speaking, you'll have to speak to the store to achieve your
goal.  For a specific implementation, that fetches a file from a
package (without building the package in question!), see package-file
in (guix packages).

Cheers


      parent reply	other threads:[~2022-04-02 20:04 UTC|newest]

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

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=689e67dd833b3ab08fc8cd16706f82b989e46b2c.camel@gmail.com \
    --to=liliana.prikler@gmail.com \
    --cc=guix-devel@gnu.org \
    --cc=terramorpha@cock.li \
    /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).