1

Why the results is 'nil5'? Can't be just 5?

#+begin_src clojure :results
(+ 1 4)
#+end_src

#+RESULTS:
: nil5

Also:

#+begin_src clojure
(print "Hello World!")
#+end_src

#+RESULTS:
: nilnil

I was expected just to print "Hello World!" in RESULTS.

slk500
  • 461
  • 2
  • 14
  • `print` doesn't return the printed string, it returns `nil`. Where the second `nil` comes from, though, I have no idea. – choroba Oct 03 '19 at 09:22
  • In second case should be #+begin_src clojure :results output to return "contents of STDOUT". https://orgmode.org/manual/Results-of-evaluation.html But :results value should output "value of last expression" but it eval everything in src_block. – slk500 Oct 03 '19 at 09:32

1 Answers1

4
#+begin_src clojure :results pp
(+ 1 4)
#+end_src

#+RESULTS:
: 5
#+begin_src clojure :results output
(print "Hello World!")
#+end_src

#+RESULTS:
: Hello World!

So we have to specify the output.

slk500
  • 461
  • 2
  • 14