From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 8AsSBo8B1mCr8AAAgWs5BA (envelope-from ) for ; Fri, 25 Jun 2021 18:17:19 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id +ALRAY8B1mBtRQAAB5/wlQ (envelope-from ) for ; Fri, 25 Jun 2021 16:17: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 1DC172AD4A for ; Fri, 25 Jun 2021 18:17:18 +0200 (CEST) Received: from localhost ([::1]:58134 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lwoW3-0004Kf-US for larch@yhetil.org; Fri, 25 Jun 2021 12:17:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54872) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lwoVP-0004KR-Jx for emacs-orgmode@gnu.org; Fri, 25 Jun 2021 12:16:35 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:37579) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lwoVM-0001Zx-Tk for emacs-orgmode@gnu.org; Fri, 25 Jun 2021 12:16:35 -0400 Received: by mail-wr1-x429.google.com with SMTP id i94so11212377wri.4 for ; Fri, 25 Jun 2021 09:16:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=andrew-cmu-edu.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=mTNgDwgO6Aonp0U9PbkMxfFxo4OWfIt+38c8xpvisrw=; b=SKJoc2kPgJRFuflYR9WFyKFQvWCJOxCfPuoF7ykzM/cczwrGhi+wzhCzCIALyeSTtX 2pu7toEmc/qixuyA9+ej2GLPK0RI8g2oI89hwDBr0v43eenTC9KN+v2wQhZssYflw+46 TJEE7l6epRemrKkHp1QWXgeu28R5/q1+blsXCVVFWKv1svpybBVNcIug8+Nxi5UcUQA0 ABu8kceSX/j5gEOw7bu2JqYJMhFv8bDi0jSP4AwgL+hvkI/J/rKcUgxmaVKAr8wuBmgc gUseCAefbIthEcaB0ybnzQSBho9jVW+ibxXpsO8iAzV9EEoIVktz5ytIfVC39033V5Tz yp7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=mTNgDwgO6Aonp0U9PbkMxfFxo4OWfIt+38c8xpvisrw=; b=cOh/6+q0WrOqAGjRhnvG1sXCBDY0QunSZMZpK6CtUKvdM10KAVUWKVHT3ztO8cFeVT U6Xhw82X9Yom7vgRgnns81zYUHdeqpNCQL/ot4lZ6cFHhxJklBfEgtpuj+THOxCpisVt NXrqDfYrZ4Nevh8vi6iZjw1ts/Lpm1TyWgTxs92mgONqjeoL+vFwnjaFRQvka1gJNRY6 ObZo+NnI3Xl4Hx2KalXNPS33H+cTN4qdJehdUbMxg4QAXtUyrKFKur741g2Ni1zFKZLn BBEQDaCvIcPzCBOaNNudxPROIDc4mHrZu6JxoimabSPxSthkpV0Dacpok2Prs1Lvg33p IYRw== X-Gm-Message-State: AOAM530Ar9fVL/7pXV6RBgRE5walnkspmvKEsXcs/ePGp6N7W5gj/Nvm 4ryqfk0t3rwxFVGesK+xA3Hs54aWnFM6fRSApJM= X-Google-Smtp-Source: ABdhPJxSIHZA5IxfFwA1f0UcCGz7a44hokq+lSoiU6Dbyg92Wkbhwu3T/OKcNkDYyAXCLJ48S4V9cFaJdMB+873cvns= X-Received: by 2002:a5d:6d83:: with SMTP id l3mr4590107wrs.91.1624637791364; Fri, 25 Jun 2021 09:16:31 -0700 (PDT) MIME-Version: 1.0 References: <892BF03F-7EA8-4DC7-BC63-90E24D98F5EF@nordakademie.de> <5C74CBCB-3AFF-4AF3-A4AC-69BF05192972@nordakademie.de> In-Reply-To: <5C74CBCB-3AFF-4AF3-A4AC-69BF05192972@nordakademie.de> From: John Kitchin Date: Fri, 25 Jun 2021 12:16:20 -0400 Message-ID: Subject: Re: appearance of list as results from evaluating code blocks To: Johannes Brauer Content-Type: multipart/alternative; boundary="000000000000716a3405c5997635" Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=johnrkitchin@gmail.com; helo=mail-wr1-x429.google.com X-Spam_score_int: 6 X-Spam_score: 0.6 X-Spam_bar: / X-Spam_report: (0.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URI_DOTEDU=1.999 autolearn=no autolearn_force=no X-Spam_action: no action 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: , Cc: "gmauer@gmail.com" , orgmode Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1624637838; 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=mTNgDwgO6Aonp0U9PbkMxfFxo4OWfIt+38c8xpvisrw=; b=CV9M2RdDcb1ZOpOLOCcDcevjoDUXD1w3QIxs3Q1yqSLaHcm8hkpInZbfYOdBQBJ7hOR4f5 fPvCx84iesbCS9BkTqJa/3LD1tqlZqkLHo8WKQ6LXXxlKAlZ5qGGWg8XT5G5qXehJVSmX3 5oCA/+t52p8DpaEqIAxT9IIK3Z/nQsK0grPL+VLs4Tb6i7u1X/Db3pn6ZUfAISUFFlPPQm k/Wps4WMXKpDdSGWeG9HIeg51DO/PMxTNm9WM6OgI7g+W4eVQZgOHWtyYQSjD9DQEIAmYb Bb5i6My+woejPd2Y5OfkdLnOq5ey7fryIIUi2uP0fzvbz4MBvCFGFxawa/tLPg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1624637838; a=rsa-sha256; cv=none; b=NtS/pme0WDExfFiFVlc/npREbmryyTUC2WGGj+SUkmfE6X0QZOC6ZTq42++wNzrqccGQKq gg1JypB/KmhUDT3tWSbFQPNioGnm1tJEWPzXg+Mn+4OunesdjAYGRJiyOMwvYLiKrjBDXE sXsmLJfIvittGJLzJDSDoZINBJSQVFyUQCgIfHL1LAOpolPuTiTU5YQdaSZ6HyI3bxxk+c s4FXgFceZgMT7Zwh2vIjyVIARTAASvxe2+Uk3NLomhG8MYsEKUw9VSvzKxjJeNjndFYtJ/ D2fyKfSnaHdAfh8xE0tCy+1LlL9mgh6LZFzCoYGRfJJPtxp0GxReQq+m6mHgCw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=andrew-cmu-edu.20150623.gappssmtp.com header.s=20150623 header.b=SKJoc2kP; 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-Migadu-Spam-Score: -1.53 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=andrew-cmu-edu.20150623.gappssmtp.com header.s=20150623 header.b=SKJoc2kP; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=andrew.cmu.edu (policy=none); 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-Migadu-Queue-Id: 1DC172AD4A X-Spam-Score: -1.53 X-Migadu-Scanner: scn1.migadu.com X-TUID: pTMIji419MpG --000000000000716a3405c5997635 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I think something is fishy in ob-clojure. When I look at how it runs, it is not obvious it is returning anything. Instead it is wrapping the body like this "(clojure.pprint/pprint (do (list 1 2 (+ 1 2))))" which I assume is going to stdout maybe? With Cider I eventually got to this intermediate result, which looks like maybe there is a terminating nil getting read from the repl that is eventually chomped to "". Result: (dict "status" ("done" "state") "id" "12" "out" "(1 2 3)\nnil\n" "session" "c72a3a11-8982-4ead-a0bf-cb92a24a966c" "ns" "user" "value" "nil" "changed-namespaces" (dict) "repl-type" "clj") That is my best guess for why you don't see the output. This happens in the function ob-clojure-eval-with-cider. John ----------------------------------- Professor John Kitchin (he/him/his) Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu On Thu, Jun 24, 2021 at 1:47 PM Johannes Brauer wrote: > Hi John! > > There is no =E2=80=9Ereturn=E2=80=9C in Lisp languages. The return value = of (list 1 2 3) > is (1 2 3). Clojure is a Lisp language similar to Elisp. So > > #+begin_src clojure :results code >> (list 1 2 (+ 1 2)) >> #+end_src >> > > should work for Clojure as it does f=C3=BCr Elisp. > > Johannes > > > Am 24.06.2021 um 18:28 schrieb John Kitchin : > > That probably means the clojure block is returning nil as the value. I > don't know what it means to return something in clojure, but here is what > you have to do with Python, for example. > > #+BEGIN_SRC python :results value code > [1, 2, 3] > #+END_SRC > > #+RESULTS: > #+begin_src python > None > #+end_src > > You have to explicitly return a value to see it. > > #+BEGIN_SRC python :results value code > return [1, 2, 3] > #+END_SRC > > #+RESULTS: > #+begin_src python > [1, 2, 3] > #+end_src > > > John > > ----------------------------------- > Professor John Kitchin (he/him/his) > Doherty Hall A207F > Department of Chemical Engineering > Carnegie Mellon University > Pittsburgh, PA 15213 > 412-268-7803 > @johnkitchin > http://kitchingroup.cheme.cmu.edu > > > > On Thu, Jun 24, 2021 at 10:31 AM Johannes Brauer > wrote: > >> What about :results code >> The default is a elisp code block so you get syntax coloring >> >> >> That works fore lisp: >> >> #+begin_src elisp :results code >> (list 1 2 (+ 1 2)) >> #+end_src >> >> #+RESULTS: >> #+begin_src elisp >> (1 2 3) >> #+end_src >> >> But with Clojure I get >> >> #+begin_src clojure :results code >> (list 1 2 (+ 1 2)) >> #+end_src >> >> #+RESULTS: >> #+begin_src clojure >> nil >> #+end_src >> >> > --000000000000716a3405c5997635 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I think something is fishy in ob-clojure.

When I look at how it runs, it is not obvious it is returning anything. = Instead it is wrapping the body like this

"(c= lojure.pprint/pprint (do (list 1 2 (+ 1 2))))"

which I assume is going to stdout maybe?=C2=A0

W= ith Cider I eventually got to this intermediate result, which looks like ma= ybe there is a terminating nil getting read from the repl that is eventuall= y chomped to "".

Result: (dict "sta= tus" ("done" "state") "id" "12"= ; "out" "(1 2 3)\nnil\n" "session" "c72a= 3a11-8982-4ead-a0bf-cb92a24a966c" "ns" "user" &quo= t;value" "nil" "changed-namespaces" (dict) "r= epl-type" "clj")

That is my bes= t=C2=A0guess for why you don't see the output. This happens in the func= tion=C2=A0ob-clojure-eval-with-cider.
John

-----------------------------------<= br>Professor John Kitchin (he/him/his)
Doherty Hall A207F
Department = of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 152= 13
412-268-7803


On Thu, Jun 24, 202= 1 at 1:47 PM Johannes Brauer <= brauer@nordakademie.de> wrote:
Hi John!

There is no =E2=80=9Ereturn=E2=80=9C in Lisp languages. The return val= ue of (list 1 2 3) is (1 2 3). Clojure is a Lisp language similar to Elisp.= So=C2=A0

#+begin_src clojure :results code
(list 1 2 (+ 1 2))
=C2=A0 #+end_src

should work for Clojure as it does f=C3=BCr Elisp.

Johannes

Am 24.06.2021 um 18:28 schrieb John Kitchin <jkitchin@andrew.cmu.edu>:
That probably means the clojure block is returning nil as = the value. I don't know what it means to return something=C2=A0in cloju= re, but here is what you have to do with Python, for example.

#+BEGIN_SRC python :results value code
[1, 2, 3]
#+END_SRC

#+RESULTS:
#+begin_src python
None
#+end_src

You have to explicitly return a value to see it.

#+BEGIN_SRC python :results value code
return [1, 2, 3]
#+END_SRC

#+RESULTS:
#+begin_src python
[1, 2, 3]
#+end_src


John

-----------------------------------
Professor John Kitchin (he/him/his)
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803


On Thu, Jun 24, 2021 at 10:31 AM Joha= nnes Brauer <brauer@nordakademie.de> wrote:
What about :results code
The default is a elisp code block so you get syntax coloring

= That works=C2=A0fore lisp:

=C2=A0 #+begin_src elisp :results code<= /span>
(list 1 2 (+ 1 2))
=C2=A0 #+end_src

=C2=A0 #+RESULTS:
=C2=A0 #+begin_src elisp
=C2=A0 (1 2 3)
=C2=A0 #+end_src

But with Clojure I get

=C2=A0 #+begin_src clojure :results cod= e
(list 1 2 (+ 1 2))
=C2=A0 #+end_src

=C2=A0 #+RESULTS:
=C2=A0 #+begin_src clojure
=C2=A0 nil
=C2=A0 #+end_src


--000000000000716a3405c5997635--