You're viewing version 1.2.0 of defn-. The latest stable version of Clojure Core is 1.3.0.
1.2.0 Arrow_down_16x16

defn-

clojure.core

  • (defn- name & decls)
same as defn, yielding non-public def

1 Example top

  • user=> (ns test)
    nil
    
    test=> (defn- foo []
             "World!")
    #'test/foo
    
    test=> (defn bar []
           (str "Hello " (foo)))
    #'test/bar
    
    test=> (foo)
    "World!"
    test=> (bar)
    "Hello World!"
    test=> (ns playground)
    nil
    playground=> (test/bar)
    "Hello World!"
    
    ;; Error will be thrown
    ;; var: #'test/foo is not public
    playground=> (test/foo)
    
Log in to add / edit an example.

See Also top

  • 0
    clojure.core/defn

    Same as (def name (fn [params* ] exprs*)) or (def name (fn ([para

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/core.clj:3823 top

(defmacro defn-
  "same as defn, yielding non-public def"
  {:added "1.0"}
  [name & decls]
    (list* `defn (with-meta name (assoc (meta name) :private true)) decls))
Vars in clojure.core/defn-: assoc defmacro list* meta name with-meta defn
Used in 2 other vars read-lines select

Comments top

No comments for defn-. Log in to add a comment.