unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Csepp <raingloom@riseup.net>
To: zimoun <zimon.toutoune@gmail.com>
Cc: help-guix@gnu.org
Subject: Re: how to fix this G-exp?
Date: Sat, 24 Sep 2022 20:40:24 +0200	[thread overview]
Message-ID: <875yhcsj4e.fsf@riseup.net> (raw)
In-Reply-To: <87czbm2e9v.fsf@gmail.com>


zimoun <zimon.toutoune@gmail.com> writes:

> Hi,
>
> I am missing something and I do not find my way, so maybe someone could
> explain me what I am doing wrong.

I'll try. UwU

> Let start with this example.
>
> (use-modules (srfi srfi-1)
>              (ice-9 match)
>              (guix packages)
>              (gnu packages))
>
> (define (package+propagated-inputs package)
>   (match (package-transitive-propagated-inputs package)
>     (((labels packages) ...)
>      (cons package packages))))
>
>
> (define (something)
>   42)
>
So this will take one of these values with the later edits you talk
about:
42
'(42)
'(42 42)
And this is used...
>
> (define (an-example)
>
>   (define build
>     (with-extensions (package+propagated-inputs
>                       (specification->package "guile-json"))
>       (with-imported-modules '((guix build utils)
>                                (json))
>         #~(begin
>             (use-modules (guix build utils)
>                          (json))
>
>             (define that
>               #+(something))
...here!  The later use of "that" is not important.
>...
When you spliced (not sliced) it, you got:
```
(define that (42))
```
As you can see, that is an unqouted list.  The fix should be pretty
simple: just add an extra quote.  Haven't tested it, but one of these
should work:
```
(define (something) ''(42))
;; or
(quote #+(something))
```

I'm pretty sure I've run into this in a service definition and used the
latter.


  reply	other threads:[~2022-09-24 18:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-23 17:26 how to fix this G-exp? zimoun
2022-09-24 18:40 ` Csepp [this message]
2022-09-25 11:18   ` zimoun
2022-09-26  8:58     ` Ludovic Courtès
2022-11-04 16:09       ` zimoun

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=875yhcsj4e.fsf@riseup.net \
    --to=raingloom@riseup.net \
    --cc=help-guix@gnu.org \
    --cc=zimon.toutoune@gmail.com \
    /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.
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).