aboutsummaryrefslogtreecommitdiff
path: root/src/clojure/contrib/fnmap.clj
diff options
context:
space:
mode:
authorStuart Sierra <mail@stuartsierra.com>2010-01-20 15:39:56 -0500
committerStuart Sierra <mail@stuartsierra.com>2010-01-20 15:39:56 -0500
commit2ede388a9267d175bfaa7781ee9d57532eb4f20f (patch)
treebb42002af196405d7e25cc4e30b4c1c9de5c06d5 /src/clojure/contrib/fnmap.clj
parent1bc820d96048a6536706ff999e9892649b53c700 (diff)
Move source files into Maven-style directory structure.
Diffstat (limited to 'src/clojure/contrib/fnmap.clj')
-rw-r--r--src/clojure/contrib/fnmap.clj36
1 files changed, 0 insertions, 36 deletions
diff --git a/src/clojure/contrib/fnmap.clj b/src/clojure/contrib/fnmap.clj
deleted file mode 100644
index f9cfc7c5..00000000
--- a/src/clojure/contrib/fnmap.clj
+++ /dev/null
@@ -1,36 +0,0 @@
-;;; fnmap.clj: maps that dispatch get/assoc to functions
-
-;; Copyright (c) Stuart Sierra, 2008. 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.
-
-
-(ns #^{:author "Stuart Sierra"
- :doc "Maps that dispatch get/assoc to user-defined functions.
-
- Note: requires AOT-compilation"}
- clojure.contrib.fnmap
- (:require clojure.contrib.fnmap.PersistentFnMap))
-
-(defn fnmap
- "Creates a fnmap, or functional map. A fnmap behaves like an
- ordinary Clojure map, except that calls to get and assoc are
- filtered through user-defined getter and setter functions, which
- operate on an internal map.
-
- (getter m key) should return a value for key.
-
- (setter m key value) should assoc key with value and return a new
- map for m.
-
- All other map operations are passed through to the internal map."
- ([getter setter] (clojure.contrib.fnmap.PersistentFnMap/create getter setter))
- ([getter setter & keyvals]
- (apply assoc
- (clojure.contrib.fnmap.PersistentFnMap/create getter setter)
- keyvals)))
-