aboutsummaryrefslogtreecommitdiff
path: root/src/main/clojure/clojure/contrib/apply_macro.clj
diff options
context:
space:
mode:
authorStuart Sierra <mail@stuartsierra.com>2010-08-07 16:41:53 -0400
committerStuart Sierra <mail@stuartsierra.com>2010-08-07 16:41:53 -0400
commita6a92b9b3d2bfd9a56e1e5e9cfba706d1aeeaae5 (patch)
treef1f3da9887dc2dc557df3282b0bcbd4d701ec593 /src/main/clojure/clojure/contrib/apply_macro.clj
parente7930c85290f77815cdb00a60604feedfa2d0194 (diff)
Split all namespaces into sub-modules.
* Examples and tests have not been copied over. * Clojure test/compile phases are commented out in parent POM. * May require installing parent POM before full build.
Diffstat (limited to 'src/main/clojure/clojure/contrib/apply_macro.clj')
-rw-r--r--src/main/clojure/clojure/contrib/apply_macro.clj45
1 files changed, 0 insertions, 45 deletions
diff --git a/src/main/clojure/clojure/contrib/apply_macro.clj b/src/main/clojure/clojure/contrib/apply_macro.clj
deleted file mode 100644
index 9df85407..00000000
--- a/src/main/clojure/clojure/contrib/apply_macro.clj
+++ /dev/null
@@ -1,45 +0,0 @@
-;;; apply_macro.clj: make macros behave like functions
-
-;; by Stuart Sierra, http://stuartsierra.com/
-;; January 28, 2009
-
-;; Copyright (c) Stuart Sierra, 2009. All rights reserved. The use
-;; and distribution terms for this software are covered by the Eclipse
-;; Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
-;; which can be found in the file epl-v10.html at the root of this
-;; distribution. By using this software in any fashion, you are
-;; agreeing to be bound by the terms of this license. You must not
-;; remove this notice, or any other, from this software.
-
-
-;; Don't use this. I mean it. It's evil. How evil? You can't
-;; handle it, that's how evil it is. That's right. I did it so you
-;; don't have to, ok? Look but don't touch. Use this lib and you'll
-;; go blind.
-
-;; DEPRECATED in 1.2 with no replacement.
-
-(ns ^{:deprecated "1.2"}
- clojure.contrib.apply-macro)
-
-;; Copied from clojure.core/spread, which is private.
-(defn- spread
- "Flatten final argument list as in apply."
- [arglist]
- (cond
- (nil? arglist) nil
- (nil? (rest arglist)) (seq (first arglist))
- :else (cons (first arglist) (spread (rest arglist)))))
-
-(defmacro apply-macro
- "This is evil. Don't ever use it. It makes a macro behave like a
- function. Seriously, how messed up is that?
-
- Evaluates all args, then uses them as arguments to the macro as with
- apply.
-
- (def things [true true false])
- (apply-macro and things)
- ;; Expands to: (and true true false)"
- [macro & args]
- (cons macro (spread (map eval args))))