help-guix
[Top][All Lists]
Advanced

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

Re: string-append plus package


From: Ludovic Courtès
Subject: Re: string-append plus package
Date: Mon, 19 Dec 2016 10:47:26 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

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-service-modules networking web)
> (define NGINX (file-append nginx "/"))
> (define TEST (string-append NGINX ""))

The result of ‘file-append’ is not a string, but ‘string-append’ expects
two strings, hence the error.

‘file-append’ returns a “string-valued gexp”.  This is to say that, in a
staging context, it will produce a string.  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!

Ludo’.



reply via email to

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