From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: string-append plus package Date: Mon, 19 Dec 2016 10:47:26 +0100 Message-ID: <87h9608d3l.fsf@gnu.org> References: <20161208195647.GA23449@jasmine> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41281) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cIuXb-0003Vv-Ss for help-guix@gnu.org; Mon, 19 Dec 2016 04:47:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cIuXY-0007HM-QH for help-guix@gnu.org; Mon, 19 Dec 2016 04:47:31 -0500 In-Reply-To: (Hartmut Goebel's message of "Mon, 19 Dec 2016 01:13:10 +0100") List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" To: Hartmut Goebel Cc: help-guix@gnu.org Hartmut Goebel 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=20=20=20=20=20 >>> (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): > #< base: # 2a236c0> suffix: ("/")>" > > (use-modules (gnu)) > (use-service-modules networking web) > (define NGINX (file-append nginx "/")) > (define TEST (string-append NGINX "")) The result of =E2=80=98file-append=E2=80=99 is not a string, but =E2=80=98s= tring-append=E2=80=99 expects two strings, hence the error. =E2=80=98file-append=E2=80=99 returns a =E2=80=9Cstring-valued gexp=E2=80= =9D. 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 =E2=80=9Cfoo=E2=80=9D containing: (foo bar "/gnu/store/=E2=80=A6-nginx-1.2.3/foo/bar") HTH! Ludo=E2=80=99.