all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Hartmut Goebel <h.goebel@crazy-compilers.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: help-guix@gnu.org
Subject: Re: string-append plus package
Date: Thu, 29 Dec 2016 11:57:16 +0100	[thread overview]
Message-ID: <3f930a82-663f-17ed-466c-d3bd021023d8@crazy-compilers.com> (raw)
In-Reply-To: <87h9608d3l.fsf@gnu.org>

Am 19.12.2016 um 10:47 schrieb Ludovic Courtès:
> Hartmut Goebel <h.goebel@crazy-compilers.com> skribis:
>
>> Am 08.12.2016 um 20:56 schrieb Leo Famulari:
>>>> Here is the service-definition I use:
>>>>
>>>>              (nginx-service #:vhost-list
>>>>                (list (nginx-vhost-configuration     
>>>>                       (root (string-append nginx "/share/nginx/html"))
>>> I believe that file-append is intended for this use case.
>> Maybe, but I can't get it to work. This minimal system declarision fails
>> with "In procedure string-append: Wrong type (expecting string):
>> #<<file-append> base: #<package nginx@1.11.6 gnu/packages/web.scm:126
>> 2a236c0> suffix: ("/")>"
>>
>> (use-modules (gnu))
>> (use-package-modules networking web)
>> (define NGINX (file-append nginx "/bin/nginxctl"))
>> (define TEST (string-append NGINX ""))
> […]For example:
>
>   (scheme-file "foo" #~(foo bar #$(file-append nginx "/foo/bar")))
>
> leads to a file “foo” containing:
>
>   (foo bar "/gnu/store/…-nginx-1.2.3/foo/bar")
>
> HTH!

I now found time trying this out. Unfortunately this does not do what I
expect. I do not need some string "(foo bar
\"/gnu/store/…-nginx-1.2.3/foo/bar\")".

I need the string "/gnu/store/…-nginx-1.2.3/bin/nginxctl". No gexpr, no
scheme magic, no string representing scheme code. But simply a string
containing the path of a file with the package (nginx in the example)
which I can assign to some variable (NGINX as shown in the example) and
then be used for other string operations (like when defining TEST in the
example).

I tried adopting your example but #~ always gave me a gexp, which of
course I can't use in string-append.

The manual says "Gexps are meant to be written to a file …" so I assume
"file-append" is the wrong approach at all

Could you please correct my above example?. Thanks.

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel@crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |

  parent reply	other threads:[~2016-12-29 10:57 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-08 17:01 string-append plus package Hartmut Goebel
2016-12-08 17:28 ` Thompson, David
2016-12-08 17:46   ` Hartmut Goebel
2016-12-08 17:47     ` Thompson, David
2016-12-08 19:56 ` Leo Famulari
2016-12-19  0:13   ` Hartmut Goebel
2016-12-19  9:47     ` Ludovic Courtès
2016-12-19 11:05       ` Hartmut Goebel
2016-12-19 13:31         ` Ludovic Courtès
2017-01-01 15:34           ` Hartmut Goebel
2017-01-02 23:05             ` Ludovic Courtès
2016-12-29 10:57       ` Hartmut Goebel [this message]
2016-12-29 13:06         ` Mathieu Lirzin
2016-12-29 14:21           ` Hartmut Goebel
2016-12-30 23:42         ` Ludovic Courtès
2016-12-31 12:56           ` Hartmut Goebel
2017-01-02 23:10             ` Ludovic Courtès

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

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

  git send-email \
    --in-reply-to=3f930a82-663f-17ed-466c-d3bd021023d8@crazy-compilers.com \
    --to=h.goebel@crazy-compilers.com \
    --cc=help-guix@gnu.org \
    --cc=ludo@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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.