From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id qAWpF6YfsF4uSwAA0tVLHw (envelope-from ) for ; Mon, 04 May 2020 13:59:02 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id wANJILEfsF4SHQAAbx9fmQ (envelope-from ) for ; Mon, 04 May 2020 13:59:13 +0000 Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:470:142::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 5371A944336 for ; Mon, 4 May 2020 13:59:11 +0000 (UTC) Received: from localhost ([::1]:58098 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jVbcl-0004MY-BW for larch@yhetil.org; Mon, 04 May 2020 09:59:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41982) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVbZi-0001OW-1x for guix-patches@gnu.org; Mon, 04 May 2020 09:56:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50258) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jVbZh-0006yI-OL for guix-patches@gnu.org; Mon, 04 May 2020 09:56:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jVbZh-0000Ou-Mn for guix-patches@gnu.org; Mon, 04 May 2020 09:56:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#40373] [PATCH] guix: new command "guix run-script" Resent-From: Konrad Hinsen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 04 May 2020 13:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40373 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: zimoun Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , 40373@debbugs.gnu.org Received: via spool by 40373-submit@debbugs.gnu.org id=B40373.158860050831564 (code B ref 40373); Mon, 04 May 2020 13:56:01 +0000 Received: (at 40373) by debbugs.gnu.org; 4 May 2020 13:55:08 +0000 Received: from localhost ([127.0.0.1]:59406 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jVbYq-0008D0-Hk for submit@debbugs.gnu.org; Mon, 04 May 2020 09:55:08 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:58249) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jVbYo-0008At-E7 for 40373@debbugs.gnu.org; Mon, 04 May 2020 09:55:06 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 0F4B65C015B; Mon, 4 May 2020 09:55:01 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Mon, 04 May 2020 09:55:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.net; h= from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=fm3; bh=y38vUl4PJfwaALkP0WHaMZhTjq NI7sLy7P4dCByIoy8=; b=yR3LDxSWDFmc/Cr2u1h8qH3J9XuU0WojO9uWRxfyvi 7Ss6I2SyPl5ggyZjU6gzdLfX4BHWlNs5BMJmusjIRkR4/ORkNL/mAVljajj2mG6s u5gIwoWCID24pTEiLuswE9xuedWIBB5+8cZJDdcz/QwffbBOfQFncPLqpHNKp4Zg Uarr5TzqEEU0ZE9dK0KhgxTbRDbBUgXv+4LjN4jfLoIeWRpgjVcySAsLtX64GfEC Mw/NOxOeSwrBL8jlS5i3loJnKJla+i4to1YIaNdWCwJ2hNPsoLW7CV/3iBC7AgHZ nN4fR7W11PVfyTX/784T0Q5xJrsm39FNrblTAW/4VSGg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=y38vUl 4PJfwaALkP0WHaMZhTjqNI7sLy7P4dCByIoy8=; b=2OVKoYz6phhbaMPPKutf5F BuArENkJF9kW41TOA5QRPeDntTZFZ32WrgWIYh5i4rf1hd7YBzq5CwYzS6XhTYPh wMRK8vzXZ0xBHWsMmhmLs903looSGHRgfPIb/87wnGeUCGPWXD6b69x5cBfA+Ppg +kMGCmz1CODQF+iLqtiN5AnFg4PEvCG/u2x2S6xnpWKisQSdR9tfweLIS7hDOYwU 5iHic2ufQNq3Z5Hrd+cd8pUxB2AzEAg6eS0/1bLACyLmOi7GIDH2lwaminXFMUgK 5AzGXENDyXDyd2ytBNg+YkCDm94m8qAGS3BZVShdz4DiP+d65vPJiH77C7R2UOiQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrjeeggdeifecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffujghffffkgggtsehttdertddttddtnecuhfhrohhmpefmohhnrhgrugcu jfhinhhsvghnuceokhhonhhrrggurdhhihhnshgvnhesfhgrshhtmhgrihhlrdhnvghtqe enucggtffrrghtthgvrhhnpeeikeejjeevueeifeejhedtgeethfdutefgveffhfeuheej veeiieegvdfhtdeifeenucfkphepledvrdduieelrddujeefrddvvdehnecuvehluhhsth gvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepkhhonhhrrggurdhhihhn shgvnhesfhgrshhtmhgrihhlrdhnvght X-ME-Proxy: Received: from khs-macbook.home (lfbn-idf2-1-1364-225.w92-169.abo.wanadoo.fr [92.169.173.225]) by mail.messagingengine.com (Postfix) with ESMTPA id 225633280059; Mon, 4 May 2020 09:55:00 -0400 (EDT) From: Konrad Hinsen In-Reply-To: References: <875zeiudjm.fsf@gnu.org> <87mu7slwwh.fsf@gnu.org> <87mu7na8g6.fsf@gnu.org> Date: Mon, 04 May 2020 15:54:59 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.7 (-) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 X-Spam-Score: 0.09 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=fastmail.net header.s=fm3 header.b=yR3LDxSW; dkim=fail (rsa verify failed) header.d=messagingengine.com header.s=fm2 header.b=2OVKoYz6; dmarc=fail reason="SPF not aligned (relaxed)" header.from=fastmail.net (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 2001:470:142::17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Scan-Result: default: False [0.09 / 13.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; GENERIC_REPUTATION(0.00)[-0.49471879555119]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2001:470:142::/48:c]; R_DKIM_REJECT(1.00)[fastmail.net:s=fm3,messagingengine.com:s=fm2]; DWL_DNSWL_FAIL(0.00)[2001:470:142::17:server fail]; FREEMAIL_FROM(0.00)[fastmail.net]; IP_REPUTATION_HAM(0.00)[asn: 22989(0.13), country: US(-0.00), ip: 2001:470:142::17(-0.49)]; DKIM_TRACE(0.00)[fastmail.net:-,messagingengine.com:-]; MX_GOOD(-0.50)[cached: eggs.gnu.org]; MAILLIST(-0.20)[mailman]; FREEMAIL_TO(0.00)[gmail.com]; RCVD_IN_DNSWL_FAIL(0.00)[2001:470:142::17:server fail]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:22989, ipnet:2001:470:142::/48, country:US]; TAGGED_FROM(0.00)[larch=yhetil.org]; FROM_NEQ_ENVFROM(0.00)[konrad.hinsen@fastmail.net,guix-patches-bounces@gnu.org]; ARC_NA(0.00)[]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; RCVD_COUNT_SEVEN(0.00)[10]; FORGED_SENDER_MAILLIST(0.00)[]; DMARC_POLICY_SOFTFAIL(0.10)[fastmail.net : SPF not aligned (relaxed),none] X-TUID: 9wJ5X65oSOn/ Hi Simon, >> That's very clever! The weak spot is the P, as script evaluation does >> not print anything. We could make it print the script's return code ;-) > > Hum? The usual REPL neither. :-) You mean... they have been LYING to us all the time... about the REPL? > Quoting Wikipedia: "print function takes the result yielded by eval" > but from my understanding 'eval' does not always yield a "printable" > result, e.g., "(define foo 42)". True, not always. But for scripts it's never. We have to find some nice three-valued logic rhetoric that applies to all situations ;-) Command line: - read an expression, - eval it, - print the result of the evaluation (if any), - and finally loop to process the next expression Scripts: - read the script file1, - eval it, - print the textual output of the script (if any), - and finally loop if there is more than one script file. That makes "print" look optional in both cases. Cheers, Konrad.