0

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.

  • print doesn't return the printed string, it returns nil. Where the second nil comes from, though, I have no idea. – choroba Oct 3 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 Oct 3 at 9:32
2
#+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, privacy policy and cookie policy

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