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 aKt0CXzuLmSCcAAASxT56A (envelope-from ) for ; Thu, 06 Apr 2023 18:08:28 +0200 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 qGtvCXzuLmSffAAA9RJhRA (envelope-from ) for ; Thu, 06 Apr 2023 18:08:28 +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 BE52637C71 for ; Thu, 6 Apr 2023 18:08:27 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pkS9L-0007kj-RN; Thu, 06 Apr 2023 12:07:47 -0400 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 1pjg45-0008Fb-VQ for emacs-orgmode@gnu.org; Tue, 04 Apr 2023 08:47:09 -0400 Received: from smtp.gajsin.name ([95.85.13.205]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pjg43-00043v-OO for emacs-orgmode@gnu.org; Tue, 04 Apr 2023 08:47:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gajsin.name ; s=x; h=Content-Type:MIME-Version:Message-ID:Date:Subject:To:From:Sender: Reply-To:Cc:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=zVhYqbknCz1l54PvqT2/NNz3OZKQjOlQJDfb6d7/7Dc=; b=qBcb7KwBeq8l843jLn1RpncKnL q6jK23LPDFzE7SVbVPhqKlmodjj5P2RZ3u8BJHry1abO7EoU/ogtsa9+7lnCM7CqQYiZyb4CMbgjA 0efDSKJTcvXIfFvz6F4cFGSI/+/rfBB2M35o4lAp4/Whx3fZXpPDdUsV7bzMtt99jMxY=; Received: from [142.93.168.49] (helo=gajsin.name) by smtp.gajsin.name with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) (envelope-from ) id 1pjg2y-00015c-2l for emacs-orgmode@gnu.org; Tue, 04 Apr 2023 12:46:00 +0000 To: emacs-orgmode@gnu.org Subject: BUG: Org babel can't return a cons cell Date: Tue, 04 Apr 2023 14:41:00 +0200 Message-ID: <87bkk3x1bu.fsf@gajsin.name> MIME-Version: 1.0 Content-Type: text/plain X-Spamd-Bar: / Received-SPF: pass client-ip=95.85.13.205; envelope-from=igor@gajsin.name; helo=smtp.gajsin.name X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Thu, 06 Apr 2023 12:07:46 -0400 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: List-Help: List-Subscribe: , Reply-to: Igor Gajsin From: Igor Gajsin via "General discussions about Org-mode." Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1680797307; a=rsa-sha256; cv=none; b=dpilJ4cTAXdbSWvkcsJMW0IesPFFitNs4rFSZrVmxx7IZpC87Fjs0BY3dD0S80s6KYAxcm 9Pb1Sy3aGq7Qx6KM3W7yrr2N3U+Mbsrc+m3M3k+6/D9lt92PI/c/huZeVDzoHAow0LgF9n NJUEeks7fEziJsFXqs1rIAmTvxnrGKhICQLiAZaO2uEltKI2U8g5UX6mQfup7ZAT4EB4pG fgWD2rM1razIEJ1PMDHSqoY3EJPzE324EoUXtm6eRrceRio2JeYMpZKykUax5i/4Q0HhCj HQXIkS5k4UNLpqDQ40vgTiMygxIou+/9omaCOxgoulfYd16LQtFjXPnYGnOKtA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none ("invalid DKIM record") header.d=gajsin.name header.s=x header.b=qBcb7KwB; dmarc=pass (policy=none) header.from=gnu.org; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1680797307; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=zVhYqbknCz1l54PvqT2/NNz3OZKQjOlQJDfb6d7/7Dc=; b=NCel5L3ZnwIDcFQIWoWPe6c280gbmmL5lbKM+uZT1neilUUmT3zwimzEl187ZVbRxRwoOU PubXNMxhjS/I0Q3KQ6uDFQ/8k6QjJewC4OpDVZxZm/FuNvREsoyNbvjYe/G68NJt5bPN0E GfWrk8QWEvuMKuX48fTOL1nLN8VZO9RCNTo79wtisRrrb0p0Bz9hPvPwAT8upoomUW5Opw 5GrvRTDwMvwahlIvdQUJoxBY1NNEYuJzr2/l8ERbhuOpgRQ2w9usv5NFtuyPZyaAKMDWog JLl7epsjNboZLAKU/3NKJ350/2e/e/dfEhlsiEMuW2VhxJqAPSys81Is8xw4OA== X-Migadu-Spam-Score: -2.52 X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=none ("invalid DKIM record") header.d=gajsin.name header.s=x header.b=qBcb7KwB; dmarc=pass (policy=none) header.from=gnu.org; 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" X-Spam-Score: -2.52 X-Migadu-Queue-Id: BE52637C71 X-TUID: edvfj8l3RPoE Hello, I've found a bug in org-babel. The simple code #+begin_src scheme (cons 1 2) #+end_src Produces an error: #+begin_quote Debugger entered--Lisp error: (wrong-type-argument listp 2) org-babel-scheme--table-or-string("(1 . 2)") org-babel-execute:scheme("(cons 1 2)" ((:colname-names) (:rowname-names) (:result-params "replace") (:result-type . value) (:results . "replace") (:exports . "code") (:session . "none") (:cache . "no") (:noweb . "no") (:hlines . "no") (:tangle . "no"))) org-babel-execute-src-block(nil ("scheme" "(cons 1 2)" ((:colname-names) (:rowname-names) (:result-params "replace") (:result-type . value) (:results . "replace") (:exports . "code") (:tangle . "no") (:hlines . "no") (:noweb . "no") (:cache . "no") (:session . "none")) "" nil 203 "(ref:%s)")) org-ctrl-c-ctrl-c(nil) funcall-interactively(org-ctrl-c-ctrl-c nil) command-execute(org-ctrl-c-ctrl-c) #+end_quote There is a fix I've found (thanks yantar92Orgcontr from #org-mode@libera.chat) #+begin_src elisp (defun org-babel-scheme--table-or-string (results) "Convert RESULTS into an appropriate elisp value. If the results look like a list or tuple, then convert them into an Emacs-lisp table, otherwise return the results as a string." (let ((res (and results (org-babel-script-escape results)))) (cond ((proper-list-p res) (mapcar (lambda (el) (if (or (null el) (eq el 'null)) org-babel-scheme-null-to el)) res)) (t res)))) #+end_src should work on emacs older then Emacs 26 (proper-list-p not implemented here). -- With best regards, Igor Gajsin