From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id UJseCutVB2RJUQAASxT56A (envelope-from ) for ; Tue, 07 Mar 2023 16:19:07 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id gJMeCutVB2R3zgAA9RJhRA (envelope-from ) for ; Tue, 07 Mar 2023 16:19:07 +0100 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 D0CDB3A6F9 for ; Tue, 7 Mar 2023 16:19:06 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.de header.s=2017 header.b="i/9c8EPD"; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1678202346; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=0msoSKjRLzZvdOeqSdtYsmhWWHCztqYRgyhnO48Qu5g=; b=q9keOaTt4SfFziP8O0zEjQSz2UssvQG+Oi2ngtfAejMv5yn7OzMLyzmIIFxkIclZgB7519 BjAUUCkoJnV56d+u2slk2syFGy5+SHkIKX/K+L4WitUmZ0GEd2YXluD56h8MA2tbUzttCV 77SQ2sfDWwUDHcQcb2zg+gkY7zYlUtbfuqj46wupDGmxL6r9/YkYZG2nM55pT55jUrJcO9 KXxFTkmaNFdLJy0d6Dtjx73f0dTZVO+4a32EON26+W3mkmLUCVMfdAn+7Tl1+cxrHVz0br x87hQOTYA8HxiFdmj1y7ydNT9WkS3TJeYuUDnePlULR6LObC19o7BCrocDfjsw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1678202346; a=rsa-sha256; cv=none; b=cBuE6y8IDhLqocnyNA1AXCNZzF+lgBna85lUYCCqiXWlavz/Zdqbh8dGUMgdmHbzyb6Dg4 FomaPjQnB6kTdbzfHFU0nqD7wAYgV2Z2Y4CJcEMFIsblMXuio1hRGxRYgNt09hAs0sQh6X By8pOl+kKMwE8Oun99BMSIX7Ucc3zap3kdlU+izDmRcyua7UkcpKUoqflJFKwXMss7wVd1 Ae5MSKeMUvWw3x88+vgECr44/OwjvJtdRScAQhBqylABTZmHlvEuyzRXYe/gxDA7GoVwy4 xyxvVOnZwVT2+rinyIlTnN1UiHbWAzOvvE3bmcdgncxomvGUC80H0LBhsAYJdQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.de header.s=2017 header.b="i/9c8EPD"; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.de Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZZ5F-0006Z4-8D; Tue, 07 Mar 2023 10:18:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZZ5E-0006Yr-4b for emacs-orgmode@gnu.org; Tue, 07 Mar 2023 10:18:32 -0500 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZZ5C-0000nk-5V for emacs-orgmode@gnu.org; Tue, 07 Mar 2023 10:18:31 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id A1A932407C1 for ; Tue, 7 Mar 2023 16:18:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1678202307; bh=d1v5KC9UNEk+0k8/WWS4/i3iqsC50FCGOcLR9mMoqk4=; h=Date:Subject:To:Cc:From:From; b=i/9c8EPDsOJipQq+uNjSIbYXU+SfbaQQQju4U8gc/dqGAb7J62x+AaWei7wT5TceJ ES4Cfv+b8Rs88uW50YXZfAHTKphslpaWC4wui0Uyfh4aeg2tT4emfO+dx0rXgH1N9W 3O8V7l1QeaVdxQ65wNcORFfWeM1wwDiQrwgljzLzuiO1CRhGvSos/60Q5A8JAt0Bls J1NkRAMxS9RxfuOAbCkW5t1AW5XeIK8JW5JvIfCVI0dxVY6YwIw3/ARAR9W0uSObjq WiKLhNCCN8fU3XE+EAP1hAuPXzPdp+jQsJfyMypaC8GWzTfOQuLs6a74QiPdVq9VD5 TqlfWkGmgm2UA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4PWJxG6fwSz6tmQ; Tue, 7 Mar 2023 16:18:26 +0100 (CET) Message-ID: <7fc63848-d6d3-80e0-ae78-00967990813d@posteo.de> Date: Tue, 7 Mar 2023 15:18:26 +0000 MIME-Version: 1.0 Subject: Re: org-babel guile source block bug in handling multiple values Content-Language: en-US To: Ihor Radchenko Cc: emacs-orgmode@gnu.org References: <9eab60bc-9b82-e037-d63b-3d879573ae32@posteo.de> <87v8jceihi.fsf@localhost> From: Zelphir Kaltstahl In-Reply-To: <87v8jceihi.fsf@localhost> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=185.67.36.66; envelope-from=zelphirkaltstahl@posteo.de; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: X-Migadu-Scanner: scn0.migadu.com X-Migadu-Queue-Id: D0CDB3A6F9 X-Spam-Score: -7.78 X-Migadu-Spam-Score: -7.78 List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-TUID: beXA0Vjm9xGW On 3/7/23 15:36, Ihor Radchenko wrote: > Zelphir Kaltstahl writes: > >> * Multiple values involving =:var= variables >> >> #+begin_src scheme :eval query-export :results output replace drawer :var x=1 :var y=2 >> (import (except (rnrs base) error vector-map) >> (only (guile) >> lambda* >> λ) >> ;; let-values >> (srfi srfi-11)) >> >> (let-values ([(a b) (values x y)]) >> (simple-format #t "~a ~a\n" a b)) >> #+end_src >> >> #+RESULTS: >> :results: >> ice-9/boot-9.scm:1685:16: In procedure raise-exception: >> Unbound variable: a >> >> Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue. >> scheme@(guile-user) [1]> >> :end: > I am not familiar with scheme, but AFAIK all ob-scheme does is wrapping > the code block into (let (...) ,@body) See `org-babel-expand-body:scheme'. > > May the problem be with your let-values form? The problem seems to be associated with returning multiple values, which `let-values` is designed to capture. The expression `(values ...)` returns 2 values and the `(let ([(a b) ]) )` will capture those 2 values, binding them to `a` and `b`. The `(let-values ...)` then creates a value (or in other scenarios any number of values) in its `` part as a result of the whole `let-values` expression. In my case the body performs a side-effect of printing something out, which is required to get something as an output of the source block. If org merely wraps in a `let`, it should not notice any of the multiple values business, because that is something done internally in `let-values`. I can run the code in geiser manually without error, but when I run it as a source block, I get the error as seen in the example org document of my original e-mail. -- repositories: https://notabug.org/ZelphirKaltstahl