' quote

syntaxsince v0.0-1853 in clojureEdit

Return the following form without evaluation, especially for symbols and lists.

  • 'foo => foo
  • '(foo) => (foo)

Details:

Quote a form to get its literal value after reading, rather than the value created after evaluation.

'foo is sugar for (quote foo).

Prevent the evaluation of the following form.


Examples:

'foo
;;=> foo

'(a b c)
;;=> (a b c)

'[a b c]
;;=> [a b c]

'(a b (c d))
;;=> (a b (c d))

See Also:


Reader table @ tools.reader:src/main/clojure/clojure/tools/reader.clj
(defn- macros [ch]
  (case ch
    \" read-string*
    \: read-keyword
    \; read-comment
    \' (wrapping-reader 'quote)
    \@ (wrapping-reader 'clojure.core/deref)
    \^ read-meta
    \` read-syntax-quote ;;(wrapping-reader 'syntax-quote)
    \~ read-unquote
    \( read-list
    \) read-unmatched-delimiter
    \[ read-vector
    \] read-unmatched-delimiter
    \{ read-map
    \} read-unmatched-delimiter
    \\ read-char*
    \% read-arg
    \# read-dispatch
    nil))