Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 776e605e70
Fetching contributors…

Cannot retrieve contributors at this time

31 lines (22 sloc) 0.64 kb
(ns day.core)
;; cannot define unless as a function because args
;; are evaluated eagerly, not lazily...
(defmacro unless [p body]
`(if ~p nil ~body))
(defmacro unless-amit [expr form]
(list 'if expr nil form))
(defmacro unless-do [expr & forms]
`(if ~expr nil (do ~@forms)))
(defmacro foo [ & f]
`(let [a# (inc 1)]
(println 'a# 'f ~@f)))
(defmacro my-declare [ & vars]
`(do ~@(map #(list 'def %) vars)))
(defmacro my-declare-2 [ & vars]
`(do ~@(for [v# vars] (list 'def v#))))
(defn def-form [x]
`(def ~x))
(defmacro my-declare-1 [ & vars]
`(do ~@(map def-form vars)))
(defmacro infix [a op b]
`(~op ~a ~b))
Jump to Line
Something went wrong with that request. Please try again.