Skip to content

Instantly share code, notes, and snippets.

View dynamitechetan's full-sized avatar
:octocat:

Chetan Kaushik dynamitechetan

:octocat:
View GitHub Profile
user=> (assert (= 3 (+ 1 1)))
Execution error (AssertionError) at user/eval142 (REPL:1).
Assert failed: (= 3 (+ 1 1))
(defmacro assert [x]
(when *assert*
`(when-not ~x
(throw (new AssertionError (str "Assert failed: "
(pr-str '~x)))))))
user=> (def x 4)
;=> #'user/x
user=> `(1 2 3 ~x 5) ;=> (1 2 3 4 5)
user=> (let [my-list (* 5 6 7 8)]
(println my-list))
user=> `(pqr xyz abc)
(user/pqr user/xyz user/abc)
user=> '({:a 1} (println 2))
({:a 1} (println 2))
user=> `({:a 1} (println 2))
({:a 1} (clojure.core/println 2))
user=> (quote ({:a 1} (println 2)))
({:a 1} (println 2))
(defmacro mah-macro [x]
(println x))
{
"SessionKey": "21a822d1-6795-4444-892e-24a79f170f6d",
"Query": {
"Country": "IN",
"Currency": "INR",
"Locale": "en-GB",
"Adults": 1,
"Children": 0,
"Infants": 0,
"OriginPlace": "10075",