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.

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

1 Answer 1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.