Warning, /frameworks/syntax-highlighting/autotests/input/clojure.clj is written in an unsupported language. File is not indexed.
0001 ; Test file, released under MIT License
0002 (ns ^{:doc "Syntax highlighting test file"
0003 :author "Markus Brenneis"}
0004 highlighting)
0005
0006 (defn something-else [f xs]
0007 #_(map #(apply f (% [%])) (cons 1 xs))
0008 (map #(apply f (% xs)) (cons 1 xs))
0009 #_[1 '(2)]
0010 xs)
0011
0012 (def foo [\a \b \n \ucafe \o123 \n
0013 \newline \tab \space \formfeed \backspace])
0014
0015 (def fizz {#{\a \b}
0016 #{\n \newline}})
0017
0018 (def fizz' #{{\a \b}
0019 {\n \newline}})
0020
0021 (defn bar [xs]
0022 (as-> xs <>
0023 (cons :a <>)
0024 (map #(%1 %2) <>) ; TODO improve
0025 (into <> [:konjure.logic.specs/numShips])))
0026
0027 (def x-2-y
0028 #_"do \" sth"
0029 (domonad set-m
0030 [x #{1.1, (+ -2 +4)}
0031 y #{1.1, (- -2.0 4.0)}]
0032 (*' x y)))
0033
0034 (def bases
0035 (and (= -1 -1N)
0036 (= 1/4 -2.5e-1)
0037 (= -1/2 -0.5M)
0038 (= -0x1Ab -0X1ab)
0039 (= +2r101010 25R1h)
0040 (= 39r13 42R10))) ; FIXME this one is not correct
0041
0042 (def ^{:private true}
0043 (= (last #{#{}}) #{{#{}}}))
0044
0045 (def s "#repl\n")
0046 (def r #"repl")
0047
0048 (defn- stuff!
0049 [a]
0050 "This is no \"documentation\"!"
0051 (= (class #'+) (class #'foo))
0052 (let [+ -] [(+ a 1) (@#'+ a 1)]))
0053
0054 (defn- throwIllegalArgumentException!
0055 "Throws an \"IllegalArgumentException\" or
0056 a js/Error."
0057 [message]
0058 #?(:clj (throw (IllegalArgumentException. message))
0059 :cljs (throw (js/Error. message))))
0060
0061 (defmacro let-fn "a nonsense macro" [one-binding & body]
0062 `(+ 1 ~(inc' 1))
0063 (let [[identifier & fn-body] one-binding]
0064 `(let [~identifier (fn ~identifier ~@fn-body)]
0065 ~@body `a#)))
0066
0067 (def state (atom [(= false true) nil]))
0068
0069 (defn something-cool [] (first @state))
0070
0071 (defn- something-different [] (first (into @state [12])))
0072
0073 (defn- instance-getfield [this k] (@(.state this) k))