From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id IKBdCt5pMWN7RgEAbAwnHQ (envelope-from ) for ; Mon, 26 Sep 2022 10:59:10 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 4G9LCt5pMWOOIQAAauVa8A (envelope-from ) for ; Mon, 26 Sep 2022 10:59:10 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 9CE38D04A for ; Mon, 26 Sep 2022 10:59:09 +0200 (CEST) Received: from localhost ([::1]:43000 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ocjxE-0001z9-Fp for larch@yhetil.org; Mon, 26 Sep 2022 04:59:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39442) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ocjwW-0001yx-1W for help-guix@gnu.org; Mon, 26 Sep 2022 04:58:24 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:34260) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ocjwV-0003Hs-Au; Mon, 26 Sep 2022 04:58:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=hDKCEmx6z9rxX3j6zA7VcqiqULyabamX5Tw9ikIuB3w=; b=Q+GnUNFLFmF3KIvxeIPx ngHddAvfBKlI0Sc3OJt/pbbIJHs68OM+8SjXFGA+7fa4yKjeiew5AFHSgpgb23j/BmjS0QSortO1+ 9lEnl9WvjoqVFSUkf4KSAr+gfe+TN577X58O5HpbGufcwWBsi9+dVJk9HditSr2E4OA55+G9xSn4V eFYJTGJisRyf0R54FBZ2U6fRc7H/LyPn6tFMabqRpVlg8ZYnOFvbYESA/qPnWSd3UiWAriuY/2QcB y1GVZoZtcVx+9c+x2gaZVhIH2BPHxouBFcC9Nn1uh5TWkhO0xGOUtSnd4BwLazWSmZ0wXFZjrqARY pYMgb7K9RcQO+Q==; Received: from [193.50.110.164] (port=51910 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ocjwU-0008Cl-T1; Mon, 26 Sep 2022 04:58:23 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: zimoun Cc: Csepp , help-guix@gnu.org Subject: Re: how to fix this G-exp? References: <87czbm2e9v.fsf@gmail.com> <875yhcsj4e.fsf@riseup.net> <86bkr3n1mp.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Quintidi 5 =?utf-8?Q?Vend=C3=A9miaire?= an 231 de la =?utf-8?Q?R=C3=A9volution=2C?= jour du Cheval X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 26 Sep 2022 10:58:20 +0200 In-Reply-To: <86bkr3n1mp.fsf@gmail.com> (zimoun's message of "Sun, 25 Sep 2022 13:18:22 +0200") Message-ID: <87tu4upl5f.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1664182749; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=hDKCEmx6z9rxX3j6zA7VcqiqULyabamX5Tw9ikIuB3w=; b=CJHwggQ5r6T8ir9PXDVgtgMIVdEg1nAIJcBdOkMwjYj64B5RaWIQ4WXpbGPqFgrnqwP8aW cn949MKHqub3xSs/SOkzfZlg1QWLZDfXysjKi45ZNF24mvfF158J/Ldskotpec1Tmmi0qD GeNnjAzZLN2EXBMp7/4u0hbQX1Ky9ui0J1u1onNeg6khqJpJso5QIWiJj6oGy+x/gGf3z4 2adCFT4MDehsdwTbzXg7pf/h6bCctSq3N/QypzaVLVBlzNCSWKqKAR03rpN7BWlLwP3N+t ocubCT74cHw+7p/1Hr25nnL8NUQ2ApWlZgTauhcvydii5H7XzxmDo6kvSRO3cw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1664182749; a=rsa-sha256; cv=none; b=q+rikXE7VJiR/MIQpdScj70PLiZNTJ1vJia/y7n2WKDR0/20vuT2hnfWv5vIXiqAchq1Sy HzZuTNhoT0SQHVFWll1+1uSuZ0etUkyjfNWkXxHni69a6p2QEwY/JDicdqZ3EaR8hq+jX1 2jrrg6hgr9Z1Kns6zU4RUv/mGWjHiWBKqP3cACe2M/uP3D2LWE2H6UQeYs6RrE2nAk5xDe L5APGdxDcJGlDHOGNzfdLeHaK6W/LCFTl+dDXszTokiX2BpwLFKRGE/vfXYajGZIsHfICJ lBVaVoZ3tNU7paXt2x3RB1o2Bct3hdFTTRoIKdz8vb2TTqomLGfzm1o7BNQ8Sg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=Q+GnUNFL; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.54 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=Q+GnUNFL; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 9CE38D04A X-Spam-Score: -2.54 X-Migadu-Scanner: scn1.migadu.com X-TUID: M/pe9mxZxJav --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, zimoun skribis: > On Sat, 24 Sep 2022 at 20:40, Csepp wrote: > >> As you can see, that is an unqouted list. The fix should be pretty >> simple: just add an extra quote. Haven't tested it, but one of these >> should work: >> ``` >> (define (something) ''(42)) >> ;; or >> (quote #+(something)) >> ``` > > The extra quote does not work. I think Csepp was on the right track though. Attached is a version where I added that quote: #~(begin =E2=80=A6 (define that '#+(something)) =E2=80=A6) AFAICS, that was the only fix that needed to be made. (I also removed (json) from the imported modules; it=E2=80=99s already taken care of by =E2=80=98with-extensions=E2=80=99.) Pro tip: to debug code staging issues like this, where you end up staging code that doesn=E2=80=99t behave as you would expect, it=E2=80=99s = useful to check what the staged code looks like, like so: --8<---------------cut here---------------start------------->8--- $ cat $(guix gc -R $(guix build -m /tmp/zimoun.scm -d)|grep example-json-bu= ild) (begin (use-modules (guix build utils) (json)) (define that (quote (42 43 4= 4))) (define file-name (string-append ((@ (guile) getenv) "out") "/example.= json")) (mkdir-p (dirname file-name)) (with-output-to-file file-name (lambd= a () (scm->json (list->vector that))))) --8<---------------cut here---------------end--------------->8--- That =E2=80=98example-json-builder=E2=80=99 file contains the staged versio= n of your code. We can see '(42 43 44) there; if we remove the quote mentioned above, we get: (define that (42 43 44)) which leads to a wrong-type-to-apply error. HTH! Ludo=E2=80=99. --=-=-= Content-Type: text/plain Content-Disposition: inline; filename=zimoun.scm Content-Description: the file (use-modules (srfi srfi-1) (ice-9 match) (guix packages) (gnu packages)) (define (package+propagated-inputs package) (match (package-transitive-propagated-inputs package) (((labels packages) ...) (cons package packages)))) (define (something) (list 42 43 44)) (define (an-example) (define build (with-extensions (package+propagated-inputs (specification->package "guile-json")) (with-imported-modules '((guix build utils)) #~(begin (use-modules (guix build utils) (json)) (define that ;; 'something' returns a list of integers; we need to quote ;; that list: it's data, not code, that we are inserting here. '#+(something)) (define file-name (string-append #$output "/example.json")) (mkdir-p (dirname file-name)) (with-output-to-file file-name (lambda () (scm->json (list->vector that)))))))) (computed-file "example-json" build)) (manifest (list (manifest-entry (name "bang") (version "0") (item (an-example))))) --=-=-=--