File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" UTF-8" ?>
2- <module version = " 4 " relativePaths =" true" type =" JAVA_MODULE" >
2+ <module relativePaths =" true" type =" JAVA_MODULE" version = " 4 " >
33 <component name =" BuildJarSettings" >
44 <containerInfo >
55 <containerElement type =" module" name =" clojure" >
1111 <setting name =" buildJar" value =" true" />
1212 <setting name =" mainClass" value =" clojure.lang.Compiler" />
1313 </component >
14- <component name =" ModuleRootManager" />
1514 <component name =" NewModuleRootManager" inherit-compiler-output =" false" >
1615 <output url =" file://$MODULE_DIR$/classes" />
1716 <exclude-output />
Original file line number Diff line number Diff line change 953953(defmacro defstruct [name & keys]
954954 `(def ~name (create-struct ~@keys)))
955955
956- (defn struct [s & inits]
956+ (defn struct-map [s & inits]
957957 (. clojure.lang.PersistentStructMap (create s inits)))
958958
959- (defn construct [s & vals]
959+ (defn struct [s & vals]
960960 (. clojure.lang.PersistentStructMap (construct s vals)))
961961
962962(defn accessor [s key]
980980 row-values (fn [] (map (fn [#^Integer i] (. rs (getObject i))) idxs))
981981 rows (fn []
982982 (when (. rs (next ))
983- (fnseq (apply construct row-struct (row-values )) thisfn)))]
983+ (fnseq (apply struct row-struct (row-values )) thisfn)))]
984984 (rows )))
985985
986+ (defn to-set [coll]
987+ (loop [ret {} keys (seq coll)]
988+ (if keys
989+ (recur (if (contains? ret (first keys))
990+ ret
991+ (assoc ret (first keys) true ))
992+ (rest keys))
993+ ret)))
994+
995+ (defn distinct [coll]
996+ (keys (to-set coll)))
997+
986998(def *exports*
987999 '(clojure
9881000 load-file load
10271039 max min
10281040 bit-shift-left bit-shift-right
10291041 bit-and bit-or bit-xor bit-not
1030- defstruct struct accessor create-struct construct
1042+ defstruct struct accessor create-struct struct-map
10311043 subvec
10321044 false ? true ?
10331045 *warn-on-reflection*
10341046 resultset-seq
1047+ to-set distinct
10351048 ))
10361049
You can’t perform that action at this time.
0 commit comments