From 01f2a94117fd62e07a29c4c586ba8f3cd206d664 Mon Sep 17 00:00:00 2001 From: Graham Carlyle Date: Mon, 27 Jul 2020 19:26:05 +0100 Subject: [PATCH] Describe non-printing of returned nil [skip ci] (#514) --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index ab26c863..314e5243 100644 --- a/README.md +++ b/README.md @@ -782,6 +782,18 @@ with `lein repl`: (nrepl-eval 52054 "(+ 1 2 3)") ;;=> "6" ``` +## Printing returned values + +Babashka doesn't print a returned `nil` as lots of scripts end in something side-effecting. + +``` shell +$ bb '(:a {:a 5}' +5 +$ bb '(:b {:a 5}' +$ +``` +If you really want to print the nil, you can use `(prn ..)` instead. + ## Differences with Clojure Babashka is implemented using the [Small Clojure