From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hartmut Goebel Subject: Re: string-append plus package Date: Thu, 29 Dec 2016 11:57:16 +0100 Message-ID: <3f930a82-663f-17ed-466c-d3bd021023d8@crazy-compilers.com> References: <20161208195647.GA23449@jasmine> <87h9608d3l.fsf@gnu.org> 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]:57821) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cMYOh-0007s9-Uf for help-guix@gnu.org; Thu, 29 Dec 2016 05:57:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cMYOe-00024R-Tz for help-guix@gnu.org; Thu, 29 Dec 2016 05:57:24 -0500 In-Reply-To: <87h9608d3l.fsf@gnu.org> 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: =?UTF-8?Q?Ludovic_Court=c3=a8s?= Cc: help-guix@gnu.org Am 19.12.2016 um 10:47 schrieb Ludovic Court=C3=A8s: > 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 >>>> (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 fai= ls >> with "In procedure string-append: Wrong type (expecting string): >> #< base: #> 2a236c0> suffix: ("/")>" >> >> (use-modules (gnu)) >> (use-package-modules networking web) >> (define NGINX (file-append nginx "/bin/nginxctl")) >> (define TEST (string-append NGINX "")) > [=E2=80=A6]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! 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/=E2=80=A6-nginx-1.2.3/foo/bar\")". I need the string "/gnu/store/=E2=80=A6-nginx-1.2.3/bin/nginxctl". No gex= pr, 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 =E2=80=A6" so I = assume "file-append" is the wrong approach at all Could you please correct my above example?. Thanks. --=20 Regards Hartmut Goebel | Hartmut Goebel | h.goebel@crazy-compilers.com | | www.crazy-compilers.com | compilers which you thought are impossible |