Re: appearance of list as results from evaluating code blocks

2021-06-26 Thread Tim Cross
John Kitchin writes: > 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

Re: appearance of list as results from evaluating code blocks

2021-06-25 Thread John Kitchin
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

Re: appearance of list as results from evaluating code blocks

2021-06-24 Thread Johannes Brauer
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

Re: appearance of list as results from evaluating code blocks

2021-06-24 Thread 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

Re: appearance of list as results from evaluating code blocks

2021-06-24 Thread Johannes Brauer
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

Re: appearance of list as results from evaluating code blocks

2021-06-24 Thread Eric S Fraga
On Thursday, 24 Jun 2021 at 10:46, Johannes Brauer wrote: > #+begin_src clojure :results verbatim :wrap src clojure > (list 1 2 (+ 1 2)) > #+end_src For completeness, another option is ":results verbatim drawer" without :wrap. -- : Eric S Fraga via Emacs 28.0.50, Org

Re: appearance of list as results from evaluating code blocks

2021-06-24 Thread Johannes Brauer
Hi Rodrigo! Thanks a lot for the detailed information. In the meantime I’ve studied the org-mode manual a bit more closely (perhaps, I should have done that before asking my question …) and found the following interesting possibilitiy: #+begin_src clojure :results verbatim :wrap src clojure

Re: appearance of list as results from evaluating code blocks

2021-06-23 Thread George Mauer
What about :results code The default is a elisp code block so you get syntax coloring On Wed, Jun 23, 2021, 16:22 Rodrigo Morales wrote: > Johannes Brauer writes: > > Johannes Brauer writes: > > > thanks, that works > > While that works, you might be interested in ":results verbatim" instead >

Re: appearance of list as results from evaluating code blocks

2021-06-23 Thread Rodrigo Morales
Johannes Brauer writes: Johannes Brauer writes: > thanks, that works While that works, you might be interested in ":results verbatim" instead of ":results raw" since when using "verbatim" the results are replaced when re-evaluating the code block. See minimal working example below. After

Re: appearance of list as results from evaluating code blocks

2021-06-23 Thread Rodrigo Morales
Johannes Brauer writes: Johannes Brauer writes: > thanks, that works While that works, you might be interested in ":results verbatim" instead of ":results raw" since when using "verbatim" the results are replaced when re-evaluating the code block. See minimal working example below. After

Re: appearance of list as results from evaluating code blocks

2021-06-23 Thread Johannes Brauer
Hi Juan Manuel, thanks, that works Best regards Johannes > Am 23.06.2021 um 21:43 schrieb Juan Manuel Macías : > > Hi Johannes, > > Johannes Brauer writes: > >> Hi! >> Evaluating a code block containing a list expression using org-babel for >> elisp or Clojure, for example >> (list 1 2 3)

Re: appearance of list as results from evaluating code blocks

2021-06-23 Thread Juan Manuel Macías
Hi Johannes, Johannes Brauer writes: > Hi! > Evaluating a code block containing a list expression using org-babel for > elisp or Clojure, for example > (list 1 2 3) > I get > #+RESULTS: > | 1 | 2 | 3 | > I would prefer > #+RESULTS: > ( 1 2 3 ) > > Is it possible to get this. Try

appearance of list as results from evaluating code blocks

2021-06-23 Thread Johannes Brauer
Hi! Evaluating a code block containing a list expression using org-babel for elisp or Clojure, for example (list 1 2 3) I get #+RESULTS: | 1 | 2 | 3 | I would prefer #+RESULTS: ( 1 2 3 ) Is it possible to get this. I am using Aquamacs 3.5nightly GNU Emacs 25.3.50.1