An entry point to the bare API.

Do not require this namespace directly. Idiomatic use is through the :api section of the ns macro.
Not used in Dunaj Lite

Bare API does not refer to any var or host class. Is used if complete control of what is referred is needed.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
(ns foo.bar
  (:api bare)
  (:require [clojure.core :refer [* println apply loop zero? dec]])
  (:import [java.lang String]))

(* 1 2)
;;=> 2

(+ 1 2)
;; Exception: Unable to resolve symbol: + in this context

(clojure.core/+ 1 2)
;;=> 3

String
;;=> java.lang.String

Object
;; Exception: Unable to resolve symbol: Object in this context

java.lang.Object
;;=> java.lang.Object

(clojure.core/defmacro recur
  "A chatty recur."
  [& args]
  `(do
     (println "recur with" [email protected])
     (clojure.core/recur [email protected])))
;;=> #'foo.bar/recur

(loop [i 5]
  (if (zero? i)
    i
    (recur (dec i))))
;; recur with 4
;; recur with 3
;; recur with 2
;; recur with 1
;; recur with 0
;;=> 0