fork(1) download
  1. ;; I've called this function "my-inc" so you don't confuse it with inc.
  2. ;; inc is a built-in function that already does this for us.
  3. (defn my-inc [n] (+ 1 n))
  4.  
  5. (println (my-inc 5))
  6.  
  7. (def my-inc-2 (fn [n] (+ 1 n)))
  8.  
  9. (println (my-inc-2 5))
  10.  
  11. (println ((fn [n] (+ 1 n)) 5))
  12.  
  13. (println (#(+ 1 %) 5))
  14.  
  15. (println (#(str %1 %2 %3) "foo" "bar" "baz"))
Success #stdin #stdout 1.67s 335488KB
stdin
Standard input is empty
stdout
6
6
6
6
foobarbaz