Hi John!

There is no „return“ 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ür Elisp.

Johannes

Am 24.06.2021 um 18:28 schrieb John Kitchin 
<jkitc...@andrew.cmu.edu<mailto:jkitc...@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 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<http://kitchingroup.cheme.cmu.edu/>



On Thu, Jun 24, 2021 at 10:31 AM Johannes Brauer 
<bra...@nordakademie.de<mailto:bra...@nordakademie.de>> 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


Reply via email to