[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: string-append plus package

From: Hartmut Goebel
Subject: Re: string-append plus package
Date: Thu, 29 Dec 2016 11:57:16 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1

Am 19.12.2016 um 10:47 schrieb Ludovic Courtès:
> Hartmut Goebel <address@hidden> 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 address@hidden 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

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

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.

Hartmut Goebel

| Hartmut Goebel          | address@hidden               |
| | compilers which you thought are impossible |

reply via email to

[Prev in Thread] Current Thread [Next in Thread]