In [4]:
(defn hello[name]
(println "Hello,"name))
Out[4]:
; text
单行注释
</td>宏(comment text)可以用来写多行注释
char
类型)\char
\tab
\newline
\space
\uunicode-hex-value
(char ascii-code)
(char \uunicode
)String
对象)"text"
(str char1 char2 ...)
:name
(keyword "name")
::name
#"pattern"
(re-pattern pattern)
,
(逗号)'(items)
(list items)
[items]
(vector items)
#{items}
(hash-set items)
(sorted-set items)
{key-value-pairs}
(hash-map key-value-pairs)
(sorted-map key-value-pairs)
#^{key-value-pairs} object
(with-meta object metadata-map)
^object
(meta object)
& name
_
(下划线)(class-name. args)
(new class-name args)
(. class-or-instance method-name args)
或者(.method-name class-or-instance args)
(.. class-or-object (method1 args) (method2 args) ...)
#(single-expression)
%
(等同于 %1
), %1
, %2来表示参数
(fn [arg-names] expressions)
@ref
(deref ref)
Var
object instead of#'name
(var name)
`
~value
(unquote value)
~@value
prefix#
(gensym prefix )
In [2]:
Out[2]:
In [ ]: