This repository has been archived by the owner on May 3, 2024. It is now read-only.
forked from richhickey/clojure-contrib
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Remove modules that were deprecated in 1.2"
This reverts commit 4e5d98a. Too many build dependencies were broken by this change; deprecated modules should be removed one-at-a-time.
- Loading branch information
Stuart Sierra
committed
Aug 20, 2010
1 parent
4e5d98a
commit 055b69c
Showing
16 changed files
with
975 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http//www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 | ||
http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.clojure.contrib</groupId> | ||
<artifactId>parent</artifactId> | ||
<version>1.3.0-SNAPSHOT</version> | ||
<relativePath>../parent</relativePath> | ||
</parent> | ||
<artifactId>apply-macro</artifactId> | ||
<dependencies> | ||
</dependencies> | ||
</project> |
45 changes: 45 additions & 0 deletions
45
modules/apply-macro/src/main/clojure/clojure/contrib/apply_macro.clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
;;; 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)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http//www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 | ||
http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.clojure.contrib</groupId> | ||
<artifactId>parent</artifactId> | ||
<version>1.3.0-SNAPSHOT</version> | ||
<relativePath>../parent</relativePath> | ||
</parent> | ||
<artifactId>http-agent</artifactId> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.clojure.contrib</groupId> | ||
<artifactId>http-connection</artifactId> | ||
<version>1.3.0-SNAPSHOT</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.clojure.contrib</groupId> | ||
<artifactId>io</artifactId> | ||
<version>1.3.0-SNAPSHOT</version> | ||
</dependency> | ||
</dependencies> | ||
</project> |
Oops, something went wrong.