From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id yPSLG9umml8sawAA0tVLHw (envelope-from ) for ; Thu, 29 Oct 2020 11:26:19 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id WLoXF9umml9AfQAAB5/wlQ (envelope-from ) for ; Thu, 29 Oct 2020 11:26:19 +0000 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 41DF2940416 for ; Thu, 29 Oct 2020 11:26:18 +0000 (UTC) Received: from localhost ([::1]:39398 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kY64N-0005iO-A4 for larch@yhetil.org; Thu, 29 Oct 2020 07:26:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49246) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kXv6X-0008Pl-1q for emacs-orgmode@gnu.org; Wed, 28 Oct 2020 19:43:45 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:51709) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kXv6V-0002XI-6w for emacs-orgmode@gnu.org; Wed, 28 Oct 2020 19:43:44 -0400 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 4A0755C0075 for ; Wed, 28 Oct 2020 19:43:39 -0400 (EDT) Received: from imap22 ([10.202.2.72]) by compute7.internal (MEProxy); Wed, 28 Oct 2020 19:43:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= mime-version:message-id:date:from:to:subject:content-type; s= fm1; bh=2klBIZZ/bWT0YSlriBjhChxBzukCr4WDbjPTAj8zZ5U=; b=YY/3pRdo Q3f0gYqbIilbNCqDO0sI2+nrxoIMOMCoZVZ7i2NY4a15zPNJXdX69fDHnEc0b8yW Wcy6lxJsULZrS0gkzm6UASDGk/o6/2wo6sVaUXb2NpsHqDybGFKUbFtbvZnxbMRc kAl3Jo2kAy8FvPfR/+ESp98W9JE3R9qVgY1fQ6JJThSn6/VuKW8MpBkoYLr/L5Kh WwexzOL/jyrLCQ5cIf/gZAp9TZR2AIIt7vyOhDZx5ilGur9WfEBdhf3vR+JH9OeY e48dYlmS0hfDgdD2k0VSTzSQZuQnxRehb+Cn7PQ/+N5mJFJ9Z3EMZiU5hSb9Wr/a BC94QH6A99VnAQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=2klBIZZ/bWT0YSlriBjhChxBzukCr 4WDbjPTAj8zZ5U=; b=TKg1pCdfHdKyH/grd0MRSLTcNMhvISxploVmq4Ul/dOSQ USFqVuJnOoObBCGFy0KK2BEQJLCVy831Q2+6dXy1bAukljSySto4Zb4uYSUT7Ues bc/gVzdjNaUc5mWnh7hvmuxeUyhDEhXxmvQYgw4OgE8HrnkcJ/riVKwkiK9utkXP Wkp5kV+9vQt8DNaZICo9BDSe6nZCTsPVifnwZ5bra3tgXXVI9yL0bLMyNMSx4PyS ovceyUsVonWxg/qq1L2o+V4FWg0hfofteOBPL0fuKzvdWo7T6HIVFNFClZZD9qOq hK5rKcEju3LnIbA4sDAJPC83z/ofIFAsbD0PtoH8A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrledvgdegudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepofgfggfkfffhvffutgesthdtredtre erjeenucfhrhhomhepfdflrghmvghsuceuohihlhgvfdcuoehjsghohihlvgesfhgrshht mhgrihhlrdgtohhmqeenucggtffrrghtthgvrhhnpeejheefveefveetteelfeehheeutd dufeeggfelfedtkeffudekgfejffetleekudenucffohhmrghinhepohhrghhmohguvgdr ohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hjsghohihlvgesfhgrshhtmhgrihhlrdgtohhm X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id E63AD6680078; Wed, 28 Oct 2020 19:43:38 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.3.0-529-g69105b1-fm-20201021.003-g69105b13 Mime-Version: 1.0 Message-Id: <50a71862-dbde-41c1-aab8-b7570d9c5d3c@www.fastmail.com> Date: Wed, 28 Oct 2020 19:43:13 -0400 From: "James Boyle" To: emacs-orgmode@gnu.org Subject: =?UTF-8?Q?Is_reading_nested_simple_lists_into_org-babel_code_blocks_curr?= =?UTF-8?Q?ently_supported=3F?= Content-Type: text/plain Received-SPF: pass client-ip=66.111.4.27; envelope-from=jboyle@fastmail.com; helo=out3-smtp.messagingengine.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/28 17:24:58 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Thu, 29 Oct 2020 07:25:51 -0400 X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=fastmail.com header.s=fm1 header.b=YY/3pRdo; dkim=pass header.d=messagingengine.com header.s=fm1 header.b=TKg1pCdf; dmarc=pass (policy=none) header.from=fastmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: 1.50 X-TUID: tShABFEBFbLu Hi all, Since this is a bit of a long post, I've put my questions and summary comment at the top, with the detailed context below. 1. What is the level of support for reading nested simple lists into org-babel code blocks? 2. When the manual (see link below) says that they are not supported, is it known if it meant "not at all supported," or, that support is currently language-dependent? 3. Directionally, does the org-mode project care to support nested simple lists? I'm happy to submit patches for both code and manual in any event, but wanted to align on if there are goals for supporting reading nested lists, and if so, at what level. At a minimum, I think updating the manual to be more precise would be great. Thanks for your any assistance you can provide. Details: I was going through the manual on this page: https://orgmode.org/manual/Environment-of-a-Code-Block.html#Environment-of-a-Code-Block and testing out the example, "A simple named list." Contrary to this line in the manual: > Note that only the top level list items are passed along. Nested list items are ignored. It looks like the example org-babel block *does* work for nested lists, depending upon the language. I am using org-mode 9.4. Here is the org block verbatim from the manual, with the results that are supposed to occur: #+NAME: example-list - simple - not - nested - list #+BEGIN_SRC emacs-lisp :var x=example-list (print x) #+END_SRC #+RESULTS: | simple | list | And here is the same block, when I evaluate it locally, with the actual results, showing that unordered, nested lists are not ignored. #+NAME: example-list - simple - not - nested - list #+BEGIN_SRC emacs-lisp :var x=example-list (print x) #+END_SRC #+RESULTS: | simple | (unordered (not) (nested)) | | list | | I thought this was a nice surprise, until I noticed that whether or not it works is language-dependent. In ruby, I get an error: #+begin_src ruby :var x=example-list # This is the error I get: # `main': undefined local variable or method `unordered' for # main:Object (NameError) puts x #+end_src #+RESULTS: And here is the equivalent error in js. Presumably other languages have variable support for this feature. #+begin_src js :var x=example-list // Below is a partial error trace: // /private/var/folders/mc/jylgk04j5r1f96hcsd3ywm8h0000gn/T/babel-shSmEq/js-script-xzngmd:2 // var x=[["simple", [unordered, ["not"], ["nested"]]], ["list"]]; ^ // ReferenceError: unordered is not defined return x #+end_src #+RESULTS: The error can be trivially "fixed" by some code like this, or making the equivalent change in the actual source line to output a string rather than a symbol. Changing L#2365 linked below to use "unordered" (string) rather than 'unordered (symbol) seemed to fix it, and produced no new test failures for me. #+begin_src emacs-lisp ; See this line for where 'unordered is being spat out: ; https://code.orgmode.org/bzg/org-mode/src/master/lisp/ob-core.el#L2365 (defun patch-get-vars-output (vars) "Substitute special Lisp symbols with a Lisp keyword. This allows Ruby to not barf on an undefined variable error for certain input structures like nested lists. Argument VARS is a tree structure. See above example format." (subst "unordered" 'unordered vars)) (advice-add 'org-babel--get-vars :filter-return #'patch-get-vars-output) #+end_src Thanks again for any help or direction you can provide. James Boyle