Commits

Meikel Brandmeyer committed 06c7f8a

Move to gradle for build system

  • Participants
  • Parent commits 5faf5aa
  • Branches new

Comments (0)

Files changed (10)

+syntax: glob
+
+build/*
+.gradle
+local.gradle
+buildscript {
+    repositories { flatDir dirs: project.file('lib') }
+    dependencies {
+        classpath "clojuresque:clojuresque:1.4.1"
+        classpath "local-dotgradle:local-dotgradle:1.0.0"
+    }
+}
+
+apply plugin: 'clojure'
+apply plugin: 'local-dotgradle'
+
+group = 'lazymap'
+version = '2.3.0-SNAPSHOT'
+
+defaultRepositories {
+    mavenCentral()
+}
+
+dependencies {
+    compile 'org.clojure:clojure:1.3.0'
+}
+
+uploadArchives {
+    clojarsDeploy()
+}

build.xml

-<project name="lazymap" default="artifacts"
-    xmlns:ivy="antlib:org.apache.ivy.ant">
-
-    <description>
-        lazymap is an implementation of a lazy map for the Clojure
-        programming language. It is to maps what lazy-seq is for
-        sequences. You can use Ivy to depend on the project. Put
-        the following in your ivy.xml:
-        &lt;dependency org="de.kotka" name="lazymap"/&gt;
-
-        In your ivysettings.xml put the following:
-        &lt;resolvers&gt;
-            &lt;url name="Kotka"&gt;
-                &lt;ivy pattern="http://kotka.de/ivy/[organisation]/[module]/[revision]/ivys/ivy.xml"/&gt;
-                &lt;artifact pattern="http://kotka.de/ivy/[organisation]/[module]/[revision]/jars/[artifact].[ext]"/&gt;
-            &lt;/url&gt;
-        &lt;/resolvers&gt;
-
-        &lt;modules&gt;
-            &lt;module organisation="de.kotka" name="lazymap" resolver="Kotka"/&gt;
-        &lt;/modules&gt;
-    </description>
-
-    <property name="src.dir" location="src"/>
-    <property name="classes.dir" location="classes"/>
-    <property name="build.dir" location="build"/>
-    <property name="lib.dir" location="lib"/>
-
-    <property name="jar.file" location="${build.dir}/lazymap.jar"/>
-    <property name="srcjar.file" location="${build.dir}/lazymap-source.jar"/>
-
-    <property name="current.version" value="2.2"/>
-
-    <property file="local.properties"/>
-
-    <target name="init" description="--> create build directories">
-        <tstamp/>
-        <mkdir dir="${classes.dir}"/>
-        <mkdir dir="${build.dir}"/>
-        <mkdir dir="${lib.dir}"/>
-    </target>
-
-    <target name="resolve" depends="init"
-        description="--> resolve dependencies with Ivy">
-        <ivy:retrieve />
-        <ivy:resolve />
-    </target>
-
-    <target name="aot" depends="resolve,init"
-        description="--> AOT compile clojure sources">
-        <java classname="clojure.lang.Compile">
-            <classpath>
-                <path location="${classes.dir}"/>
-                <path location="${src.dir}"/>
-                <fileset dir="${lib.dir}" includes="**/*.jar"/>
-            </classpath>
-            <sysproperty key="clojure.compile.path" value="${classes.dir}"/>
-            <arg value="de.kotka.lazymap"/>
-        </java>
-    </target>
-
-    <target name="artifacts" depends="aot"
-        description="--> create source and artifact jars">
-        <jar jarfile="${jar.file}">
-            <fileset file="README.txt"/>
-            <fileset file="LICENSE.txt"/>
-            <fileset dir="${classes.dir}" includes="de/kotka/**/*.class"/>
-            <manifest>
-                <attribute name="Class-Path" value="."/>
-            </manifest>
-        </jar>
-
-        <jar jarfile="${srcjar.file}">
-            <fileset file="README.txt"/>
-            <fileset file="LICENSE.txt"/>
-            <fileset dir="${src.dir}" includes="**/*.clj"/>
-        </jar>
-    </target>
-
-    <target name="clean" description="--> clean generated files">
-        <delete dir="${classes.dir}"/>
-        <delete dir="${build.dir}"/>
-    </target>
-
-    <target name="clean-lib" description="--> clean library files">
-        <delete dir="${lib.dir}"/>
-    </target>
-
-    <target name="clean-local" description="--> clean local repository">
-        <ivy:info />
-        <delete dir="${ivy.local.default.root}/${ivy.organisation}/${ivy.module}"/>
-    </target>
-
-    <target name="clean-all" depends="clean,clean-lib,clean-local"
-        description="--> clean all project files"/>
-
-    <target name="publish"
-        description="--> publish artifacts in the shared repository">
-        <ivy:info />
-        <ivy:buildnumber
-            organisation="${ivy.organisation}"
-            module="${ivy.module}"
-            revision="${current.version}"/>
-        <ivy:publish
-            resolver="shared"
-            artifactspattern="${build.dir}/[artifact].[ext]"
-            pubrevision="${ivy.new.revision}"
-            status="release"/>
-    </target>
-
-    <target name="publish-local"
-        description="--> publish artifacts in the local repository">
-        <tstamp>
-            <format property="now" pattern="yyyyMMddHHmmss"/>
-        </tstamp>
-        <ivy:info />
-        <ivy:publish
-            resolver="local"
-            artifactspattern="${build.dir}/[artifact].[ext]"
-            pubrevision="${now}"
-            pubdate="${now}"
-            status="integration"
-            forcedeliver="true"/>
-    </target>
-
-</project>

ivy.xml

-<ivy-module version="2.0">
-
-    <info organisation="de.kotka" module="lazymap" status="integration"/>
-
-    <configurations>
-        <conf name="default"/>
-        <conf name="dev" extends="default"/>
-    </configurations>
-
-    <publications>
-        <artifact name="lazymap" type="jar" conf="default"/>
-        <artifact name="lazymap-source" type="jar" conf="dev"/>
-    </publications>
-
-    <!--
-    <dependencies>
-        <dependency org="org.clojure" name="clojure-lang" rev="1.0.0"
-            conf="*->default"/>
-    </dependencies>
-    -->
-
-</ivy-module>

ivysettings.xml

-<ivysettings>
-
-    <!-- Load the standard Ivy settings. Which just extend them for Clojure. -->
-    <include url="${ivy.default.settings.dir}/ivysettings.xml"/>
-    <include url="http://kotka.de/ivy/ivysettings.xml"/>
-
-</ivysettings>

lib/clojuresque-1.4.1.jar

Binary file added.

lib/local-dotgradle-1.0.0.jar

Binary file added.
+rootProject.name = 'lazymap'

src/de/kotka/lazymap.clj

-;-
-; Copyright 2008,2009 (c) Meikel Brandmeyer.
-; All rights reserved.
-;
-; Permission is hereby granted, free of charge, to any person obtaining a copy
-; of this software and associated documentation files (the "Software"), to deal
-; in the Software without restriction, including without limitation the rights
-; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-; copies of the Software, and to permit persons to whom the Software is
-; furnished to do so, subject to the following conditions:
-;
-; The above copyright notice and this permission notice shall be included in
-; all copies or substantial portions of the Software.
-;
-; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-; THE SOFTWARE.
-
-(clojure.core/ns de.kotka.lazymap
-  "Lazymap is to maps what lazy-seq is to lists. It allows to store values
-  with evaluating them. This is only done in case the value is really accessed.
-  Lazymap works with any map type (hash-map, sorted-map, struct-map) and may
-  be used as a drop-in replacement everywhere where a normal map type may be
-  used.
-
-  Available macros:
-  lazy-hash-map, lazy-sorted-map, lazy-struct-map, lazy-struct, lazy-assoc
-  and their * counterpart functions."
-  (:import
-     clojure.lang.IObj
-     clojure.lang.IFn
-     clojure.lang.IMapEntry
-     clojure.lang.IPersistentVector
-     clojure.lang.ISeq
-     clojure.lang.SeqIterator))
-
-(gen-interface
-  :name    de.kotka.lazymap.ILazyMapEntry
-  :extends [clojure.lang.IMapEntry]
-  :methods [[getRawValue [] clojure.lang.Delay]])
-
-(gen-interface
-  :name    de.kotka.lazymap.ILazyMap
-  :extends [clojure.lang.IPersistentMap]
-  :methods [[lazyAssoc [Object Object] de.kotka.lazymap.ILazyMap]])
-
-(import
-  'de.kotka.lazymap.ILazyMapEntry
-  'de.kotka.lazymap.ILazyMap)
-
-(defn create-lazy-map-entry
-  [k v]
-  (reify this [ILazyMapEntry]
-    ; ILazyMapEntry
-    (.getRawValue
-      []
-      v)
-    ; IMapEntry
-    (.key
-      []
-      (.getKey this))
-    (.getKey
-      []
-      k)
-    (.val
-      []
-      (.getValue this))
-    (.getValue
-      []
-      (force v))
-    ; Object
-    (.toString
-      []
-      (str \[ (.getKey this) \space (.getValue this) \]))))
-
-(defmethod print-method ILazyMapEntry
-  [#^ILazyMapEntry this #^java.io.Writer writer]
-  (.write writer (.toString this)))
-
-(defn create-lazy-map-seq
-  ([inner-seq]
-   (create-lazy-map-seq inner-seq nil))
-  ([inner-seq metadata]
-   (reify this [ISeq IObj]
-     ; ISeq
-     (.first
-       []
-       (let [first-val (first inner-seq)]
-         (create-lazy-map-entry (key first-val) (val first-val))))
-     (.next
-       []
-       (when-let [inner-rest (next inner-seq)]
-         (create-lazy-map-seq inner-rest metadata)))
-     (.more
-       []
-       (lazy-seq
-         (.next this)))
-     (.cons
-       [o]
-       (concat [o] this))
-     ; IPersistentCollection
-     (.count
-       []
-       (count inner-seq))
-     (.empty
-       []
-       ())
-     (.seq
-       []
-       this)
-     ; IObj
-     (.withMeta
-       [new-metadata]
-       (create-lazy-map-seq inner-seq new-metadata))
-     ;IMeta
-     (.meta
-       []
-       metadata))))
-
-(defn create-lazy-map
-  ([base]
-   (create-lazy-map base nil))
-  ([base metadata]
-   (reify this [ILazyMap IFn IObj]
-     ; ILazyMap
-     (.lazyAssoc
-       [k v]
-       (create-lazy-map (assoc base k v) metadata))
-     ; IPersistentMap
-     (.assoc
-       [k v]
-       (create-lazy-map (assoc base k (delay v)) metadata))
-     (.assocEx
-       [k v]
-       (when (.containsKey base k)
-         (throw (Exception. (str "Key already present in map: " k))))
-       (.assoc this k v))
-     (.without
-       [k]
-       (create-lazy-map (dissoc base k) metadata))
-     ; Associative
-     (.containsKey
-       [k]
-       (contains? base k))
-     (.entryAt
-       [k]
-       (create-lazy-map-entry k (base k)))
-     ; IPersistentCollection
-     (.count
-       []
-       (count base))
-     (.cons
-       [o]
-       (condp instance? o
-         ILazyMapEntry     (let [#^ILazyMapEntry o o]
-                             (let [k (.getKey o)
-                                   v (.getRawValue o)]
-                               (.lazyAssoc this k v)))
-         IMapEntry         (let [#^IMapEntry o o]
-                             (let [k (.getKey o)
-                                   v (.getValue o)]
-                               (.assoc this k (delay v))))
-         IPersistentVector (if (= (count o) 2)
-                             (let [k (o 0)
-                                   v (o 1)]
-                               (.assoc this k (delay v)))
-                             (throw (IllegalArgumentException.
-                                      "Vector arg to map conj must be a pair")))
-         (reduce #(.cons #^ILazyMap %1 %2) this o)))
-     (.empty
-       []
-       (create-lazy-map (empty base) nil))
-     ; ILookup
-     (.valAt
-       [k]
-       (.valAt this k nil))
-     (.valAt
-       [k not-found]
-       (if (contains? base k)
-         (-> base (get k) force)
-         not-found))
-     ; IFn
-     (.invoke
-       [k]
-       (.valAt this k nil))
-     (.invoke
-       [k not-found]
-       (.valAt this k not-found))
-     (.applyTo
-       [args]
-       (let [[k v & rest-args :as args] (seq args)]
-         (when (or (not args) rest-args)
-           (throw (Exception. "lazy map must be called with one or two arguments")))
-         (.valAt this k v)))
-     ; Seqable
-     (.seq
-       []
-       (when-let [inner-seq (seq base)]
-         (create-lazy-map-seq inner-seq)))
-     ; IObj
-     (.withMeta
-       [new-metadata]
-       (create-lazy-map base new-metadata))
-     ; IMeta
-     (.meta
-       []
-       metadata)
-     ; Iterable
-     (.iterator
-       []
-       (-> this .seq SeqIterator.)))))
-
-(defn- quote-values
-  [kvs]
-  (mapcat (fn [[k v]] [k `(delay ~v)]) (partition 2 kvs)))
-
-(defn lazy-assoc*
-  "lazy-assoc* is like lazy-assoc but a function and takes values as delays
-  instead of expanding into a delay of val."
-  [m & kvs]
-  (assert (even? (count kvs)))
-  (reduce (fn [m [k v]] (.lazyAssoc m k v)) m (partition 2 kvs)))
-
-(defmacro lazy-assoc
-  "lazy-assoc associates new values to the given keys in the given lazy map.
-  The values are not evaluated, before their first retrieval. They are
-  evaluated at most once."
-  [m & kvs]
-  `(lazy-assoc* ~m ~@(quote-values kvs)))
-
-(defn lazy-hash-map*
-  "lazy-hash-map* is the same as lazy-hash-map except that its a function
-  and it takes a seq of keys-delayed-value pairs."
-  [& kvs]
-  (create-lazy-map (apply hash-map kvs)))
-
-(defmacro lazy-hash-map
-  "lazy-hash-map creates a map. The values are not evaluated before their
-  first retrieval. Each value is evaluated at most once. The underlying map
-  is a hash map."
-  [& kvs]
-  `(lazy-hash-map* ~@(quote-values kvs)))
-
-(defn lazy-sorted-map*
-  "lazy-sorted-map* is the same as lazy-sorted-map except that its a
-  function and it takes a seq of keys-delayed-value pairs."
-  [& kvs]
-  (create-lazy-map (apply sorted-map kvs)))
-
-(defmacro lazy-sorted-map
-  "lazy-sorted-map creates a map. The values are not evaluated before their
-  first retrieval. Each value is evaluated at most once. The underlying map
-  is a sorted map."
-  [& kvs]
-  `(lazy-sorted-map* ~@(quote-values kvs)))
-
-(defn lazy-struct-map*
-  "lazy-struct-map* is the same as lazy-struct-map except that its a
-  function and it takes a seq of keys-delayed-value pairs together with the
-  struct basis."
-  [s & kvs]
-  (create-lazy-map (apply struct-map s kvs)))
-
-(defmacro lazy-struct-map
-  "lazy-struct-map creates a map. The values are not evaluated before their
-  first retrieval. Each value is evaluated at most once. The underlying map
-  is a struct map according to the provided structure s."
-  [s & kvs]
-  `(lazy-struct-map* ~s ~@(quote-values kvs)))
-
-(defn lazy-struct*
-  "lazy-struct* is the same as lazy-struct except that its a function and
-  it takes a seq of delayed value together with the struct basis."
-  [s & vs]
-  (create-lazy-map (apply struct s vs)))
-
-(defmacro lazy-struct
-  "lazy-struct creates a map. The values are not evaluated before their
-  first retrieval. Each value is evaluated at most once. The underlying map
-  is a struct map according to the provided structure s. As with Clojure's
-  struct the values have to appear in the order of the keys in the structure."
-  [s & vs]
-  (let [vs (map (fn [v] `(delay ~v)) vs)]
-    `(lazy-struct* ~s ~@vs)))

src/main/clojure/de/kotka/lazymap.clj

+;-
+; Copyright 2008,2009 (c) Meikel Brandmeyer.
+; All rights reserved.
+;
+; Permission is hereby granted, free of charge, to any person obtaining a copy
+; of this software and associated documentation files (the "Software"), to deal
+; in the Software without restriction, including without limitation the rights
+; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+; copies of the Software, and to permit persons to whom the Software is
+; furnished to do so, subject to the following conditions:
+;
+; The above copyright notice and this permission notice shall be included in
+; all copies or substantial portions of the Software.
+;
+; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+; THE SOFTWARE.
+
+(clojure.core/ns de.kotka.lazymap
+  "Lazymap is to maps what lazy-seq is to lists. It allows to store values
+  with evaluating them. This is only done in case the value is really accessed.
+  Lazymap works with any map type (hash-map, sorted-map, struct-map) and may
+  be used as a drop-in replacement everywhere where a normal map type may be
+  used.
+
+  Available macros:
+  lazy-hash-map, lazy-sorted-map, lazy-struct-map, lazy-struct, lazy-assoc
+  and their * counterpart functions."
+  (:import
+     clojure.lang.IObj
+     clojure.lang.IFn
+     clojure.lang.IMapEntry
+     clojure.lang.IPersistentVector
+     clojure.lang.ISeq
+     clojure.lang.SeqIterator))
+
+(gen-interface
+  :name    de.kotka.lazymap.ILazyMapEntry
+  :extends [clojure.lang.IMapEntry]
+  :methods [[getRawValue [] clojure.lang.Delay]])
+
+(gen-interface
+  :name    de.kotka.lazymap.ILazyMap
+  :extends [clojure.lang.IPersistentMap]
+  :methods [[lazyAssoc [Object Object] de.kotka.lazymap.ILazyMap]])
+
+(import
+  'de.kotka.lazymap.ILazyMapEntry
+  'de.kotka.lazymap.ILazyMap)
+
+(defn create-lazy-map-entry
+  [k v]
+  (reify this [ILazyMapEntry]
+    ; ILazyMapEntry
+    (.getRawValue
+      []
+      v)
+    ; IMapEntry
+    (.key
+      []
+      (.getKey this))
+    (.getKey
+      []
+      k)
+    (.val
+      []
+      (.getValue this))
+    (.getValue
+      []
+      (force v))
+    ; Object
+    (.toString
+      []
+      (str \[ (.getKey this) \space (.getValue this) \]))))
+
+(defmethod print-method ILazyMapEntry
+  [#^ILazyMapEntry this #^java.io.Writer writer]
+  (.write writer (.toString this)))
+
+(defn create-lazy-map-seq
+  ([inner-seq]
+   (create-lazy-map-seq inner-seq nil))
+  ([inner-seq metadata]
+   (reify this [ISeq IObj]
+     ; ISeq
+     (.first
+       []
+       (let [first-val (first inner-seq)]
+         (create-lazy-map-entry (key first-val) (val first-val))))
+     (.next
+       []
+       (when-let [inner-rest (next inner-seq)]
+         (create-lazy-map-seq inner-rest metadata)))
+     (.more
+       []
+       (lazy-seq
+         (.next this)))
+     (.cons
+       [o]
+       (concat [o] this))
+     ; IPersistentCollection
+     (.count
+       []
+       (count inner-seq))
+     (.empty
+       []
+       ())
+     (.seq
+       []
+       this)
+     ; IObj
+     (.withMeta
+       [new-metadata]
+       (create-lazy-map-seq inner-seq new-metadata))
+     ;IMeta
+     (.meta
+       []
+       metadata))))
+
+(defn create-lazy-map
+  ([base]
+   (create-lazy-map base nil))
+  ([base metadata]
+   (reify this [ILazyMap IFn IObj]
+     ; ILazyMap
+     (.lazyAssoc
+       [k v]
+       (create-lazy-map (assoc base k v) metadata))
+     ; IPersistentMap
+     (.assoc
+       [k v]
+       (create-lazy-map (assoc base k (delay v)) metadata))
+     (.assocEx
+       [k v]
+       (when (.containsKey base k)
+         (throw (Exception. (str "Key already present in map: " k))))
+       (.assoc this k v))
+     (.without
+       [k]
+       (create-lazy-map (dissoc base k) metadata))
+     ; Associative
+     (.containsKey
+       [k]
+       (contains? base k))
+     (.entryAt
+       [k]
+       (create-lazy-map-entry k (base k)))
+     ; IPersistentCollection
+     (.count
+       []
+       (count base))
+     (.cons
+       [o]
+       (condp instance? o
+         ILazyMapEntry     (let [#^ILazyMapEntry o o]
+                             (let [k (.getKey o)
+                                   v (.getRawValue o)]
+                               (.lazyAssoc this k v)))
+         IMapEntry         (let [#^IMapEntry o o]
+                             (let [k (.getKey o)
+                                   v (.getValue o)]
+                               (.assoc this k (delay v))))
+         IPersistentVector (if (= (count o) 2)
+                             (let [k (o 0)
+                                   v (o 1)]
+                               (.assoc this k (delay v)))
+                             (throw (IllegalArgumentException.
+                                      "Vector arg to map conj must be a pair")))
+         (reduce #(.cons #^ILazyMap %1 %2) this o)))
+     (.empty
+       []
+       (create-lazy-map (empty base) nil))
+     ; ILookup
+     (.valAt
+       [k]
+       (.valAt this k nil))
+     (.valAt
+       [k not-found]
+       (if (contains? base k)
+         (-> base (get k) force)
+         not-found))
+     ; IFn
+     (.invoke
+       [k]
+       (.valAt this k nil))
+     (.invoke
+       [k not-found]
+       (.valAt this k not-found))
+     (.applyTo
+       [args]
+       (let [[k v & rest-args :as args] (seq args)]
+         (when (or (not args) rest-args)
+           (throw (Exception. "lazy map must be called with one or two arguments")))
+         (.valAt this k v)))
+     ; Seqable
+     (.seq
+       []
+       (when-let [inner-seq (seq base)]
+         (create-lazy-map-seq inner-seq)))
+     ; IObj
+     (.withMeta
+       [new-metadata]
+       (create-lazy-map base new-metadata))
+     ; IMeta
+     (.meta
+       []
+       metadata)
+     ; Iterable
+     (.iterator
+       []
+       (-> this .seq SeqIterator.)))))
+
+(defn- quote-values
+  [kvs]
+  (mapcat (fn [[k v]] [k `(delay ~v)]) (partition 2 kvs)))
+
+(defn lazy-assoc*
+  "lazy-assoc* is like lazy-assoc but a function and takes values as delays
+  instead of expanding into a delay of val."
+  [m & kvs]
+  (assert (even? (count kvs)))
+  (reduce (fn [m [k v]] (.lazyAssoc m k v)) m (partition 2 kvs)))
+
+(defmacro lazy-assoc
+  "lazy-assoc associates new values to the given keys in the given lazy map.
+  The values are not evaluated, before their first retrieval. They are
+  evaluated at most once."
+  [m & kvs]
+  `(lazy-assoc* ~m ~@(quote-values kvs)))
+
+(defn lazy-hash-map*
+  "lazy-hash-map* is the same as lazy-hash-map except that its a function
+  and it takes a seq of keys-delayed-value pairs."
+  [& kvs]
+  (create-lazy-map (apply hash-map kvs)))
+
+(defmacro lazy-hash-map
+  "lazy-hash-map creates a map. The values are not evaluated before their
+  first retrieval. Each value is evaluated at most once. The underlying map
+  is a hash map."
+  [& kvs]
+  `(lazy-hash-map* ~@(quote-values kvs)))
+
+(defn lazy-sorted-map*
+  "lazy-sorted-map* is the same as lazy-sorted-map except that its a
+  function and it takes a seq of keys-delayed-value pairs."
+  [& kvs]
+  (create-lazy-map (apply sorted-map kvs)))
+
+(defmacro lazy-sorted-map
+  "lazy-sorted-map creates a map. The values are not evaluated before their
+  first retrieval. Each value is evaluated at most once. The underlying map
+  is a sorted map."
+  [& kvs]
+  `(lazy-sorted-map* ~@(quote-values kvs)))
+
+(defn lazy-struct-map*
+  "lazy-struct-map* is the same as lazy-struct-map except that its a
+  function and it takes a seq of keys-delayed-value pairs together with the
+  struct basis."
+  [s & kvs]
+  (create-lazy-map (apply struct-map s kvs)))
+
+(defmacro lazy-struct-map
+  "lazy-struct-map creates a map. The values are not evaluated before their
+  first retrieval. Each value is evaluated at most once. The underlying map
+  is a struct map according to the provided structure s."
+  [s & kvs]
+  `(lazy-struct-map* ~s ~@(quote-values kvs)))
+
+(defn lazy-struct*
+  "lazy-struct* is the same as lazy-struct except that its a function and
+  it takes a seq of delayed value together with the struct basis."
+  [s & vs]
+  (create-lazy-map (apply struct s vs)))
+
+(defmacro lazy-struct
+  "lazy-struct creates a map. The values are not evaluated before their
+  first retrieval. Each value is evaluated at most once. The underlying map
+  is a struct map according to the provided structure s. As with Clojure's
+  struct the values have to appear in the order of the keys in the structure."
+  [s & vs]
+  (let [vs (map (fn [v] `(delay ~v)) vs)]
+    `(lazy-struct* ~s ~@vs)))