rlm@0
|
1 (ns rlm.light-base
|
rlm@0
|
2 {:author "Robert McIntyre"}
|
rlm@0
|
3 (:refer-clojure :only [])
|
rlm@0
|
4 (:require [rlm [ns-rlm]]))
|
rlm@0
|
5
|
rlm@0
|
6
|
rlm@0
|
7
|
rlm@0
|
8 ;;We start with absolutely nothing and build from there
|
rlm@0
|
9 (rlm.ns-rlm/ns-clear) ;; all we have is [def if ns in-ns].
|
rlm@0
|
10
|
rlm@0
|
11
|
rlm@0
|
12 (clojure.core/use
|
rlm@0
|
13 :reload
|
rlm@0
|
14 '[clojure
|
rlm@0
|
15 [core
|
rlm@0
|
16 :only
|
rlm@0
|
17 [
|
rlm@0
|
18 ;; object stuff
|
rlm@0
|
19 extend-type
|
rlm@0
|
20
|
rlm@0
|
21
|
rlm@0
|
22 *command-line-args* *err* *out* *warn-on-reflection* val name read-line
|
rlm@0
|
23 ;;REPL
|
rlm@0
|
24 find-doc doc print-doc print-namespace-doc
|
rlm@0
|
25 ;;Regexes
|
rlm@0
|
26 re-pattern re-matcher re-groups re-seq re-matches re-find
|
rlm@0
|
27 ;; Unsorted
|
rlm@0
|
28 meta type with-meta vary-meta defmacro str let binding with-bindings bound-fn bound-fn* eval
|
rlm@0
|
29 time macroexpand-1 macroexpand destructure comment test rand rand-int subs hash
|
rlm@0
|
30 definline alter-var-root format printf defonce refer-clojure gen-class load letfn
|
rlm@0
|
31 gen-interface definterface reify munge defrecord deftype extenders defprotocol
|
rlm@0
|
32 extend extend-protocol slurp clojure-version char assert read
|
rlm@0
|
33 ;; Printing
|
rlm@0
|
34 print-method print-dup newline flush print println prn with-in-str with-out-str
|
rlm@0
|
35 print-str println-str *print-length* *print-level* print-ctor primitives-classnames
|
rlm@0
|
36 ;;Agents
|
rlm@0
|
37 agent send send-off release-pending-sends
|
rlm@0
|
38 add-watch remove-watch agent-error restart-agent set-error-handler! error-handler
|
rlm@0
|
39 set-error-mode! error-mode shutdown-agents
|
rlm@0
|
40 ;;Ref
|
rlm@0
|
41 ref deref
|
rlm@0
|
42 ;;Atom
|
rlm@0
|
43 atom swap! compare-and-set! reset! set-validator! get-validator alter-meta!
|
rlm@0
|
44 reset-meta! commute alter ref-set ref-history-count ref-min-history ref-max-history
|
rlm@0
|
45 ensure sync dosync
|
rlm@0
|
46 ;;MultiMethods
|
rlm@0
|
47 defmulti defmethod remove-all-methods remove-method prefer-method
|
rlm@0
|
48 methods get-method prefers
|
rlm@0
|
49 ;;Numerics
|
rlm@0
|
50 inc dec rem quot rationalize mod numerator denominator
|
rlm@0
|
51 ;;Bits
|
rlm@0
|
52 bit-and bit-or bit-xor bit-and-not bit-clear bit-set
|
rlm@0
|
53 bit-flip bit-test bit-shift-left bit-shift-right
|
rlm@0
|
54 ;; Logic
|
rlm@0
|
55 not =
|
rlm@0
|
56 ;; Creation
|
rlm@0
|
57 symbol gensym keyword int declare num long float double short byte boolean
|
rlm@0
|
58 bigint bigdec transient persistent! assoc!
|
rlm@0
|
59 ;; Lists
|
rlm@0
|
60 list list* rest next cons first second last butlast
|
rlm@0
|
61 ;; Maps
|
rlm@0
|
62 hash-map sorted-map sorted-map-by find select-keys keys vals
|
rlm@0
|
63 merge merge-with zipmap create-struct defstruct struct-map struct get-in
|
rlm@0
|
64 assoc-in update-in map-indexed key
|
rlm@0
|
65 ;; Sets
|
rlm@0
|
66 set sorted-set sorted-set-by disj split-at split-with
|
rlm@0
|
67 ;; Vectors
|
rlm@0
|
68 vector vec subvec vector-of
|
rlm@0
|
69 ;; Arrays
|
rlm@0
|
70 to-array into-array alength aclone aget aset aset-int aset-long
|
rlm@0
|
71 aset-boolean aset-float aset-double aset-short aset-long aset-byte aset-char
|
rlm@0
|
72 aset-int make-array to-array-2d amap areduce boolean-array byte-array char-array
|
rlm@0
|
73 short-array double-array object-array int-array long-array booleans chars
|
rlm@0
|
74 shorts floats ints doubles longs partition-all
|
rlm@0
|
75 ;; Seqs
|
rlm@0
|
76 lazy-seq nth rseq reverse concat peek pop sequence every? not-every? some
|
rlm@0
|
77 not-any? take take-while drop drop-last take-last drop-while cycle repeat
|
rlm@0
|
78 replicate iterate range line-seq sort sort-by partition doseq dorun doall
|
rlm@0
|
79 take-nth interleave lazy-cat tree-seq file-seq xml-seq distinct
|
rlm@0
|
80 replace subseq rsubseq interpose seque not-empty flatten group-by count
|
rlm@0
|
81 partition-by frequencies shuffle
|
rlm@0
|
82 ;; Functions
|
rlm@0
|
83 fn defn defn- apply complement constantly identity comp juxt partial repeatedly
|
rlm@0
|
84 trampoline memoize pmap pcalls pvalues fnil
|
rlm@0
|
85 ;; List Comprehensions
|
rlm@0
|
86 reduce reductions map mapcat filter remove keep keep-indexed for
|
rlm@0
|
87 ;; Predicates
|
rlm@0
|
88 instance? seq? char? string? map? vector? nil?
|
rlm@0
|
89 false? true? symbol? keyword? delay? future? future-done?
|
rlm@0
|
90 even? odd? contains? number? integer? ratio? decimal? reversible?
|
rlm@0
|
91 float? rational? special-symbol? var? class? bound? thread-bound? counted?
|
rlm@0
|
92 distinct? empty? coll? list? set? ifn? fn? associative? sequential? sorted?
|
rlm@0
|
93 extends? satisfies? future-cancelled?
|
rlm@0
|
94 comparator
|
rlm@0
|
95 ;; Comparason
|
rlm@0
|
96 compare not= identical? ==
|
rlm@0
|
97 ;; Control Flow
|
rlm@0
|
98 when when-not cond delay force if-not and or locking -> ->> while case
|
rlm@0
|
99 if-let when-let dotimes await await-for with-open doto loop condp future-call
|
rlm@0
|
100 future future-cancel promise deliver
|
rlm@0
|
101 ;;Namespaces
|
rlm@0
|
102 create-ns find-ns remove-ns all-ns the-ns ns-name ns-map ns-unmap ns-publics
|
rlm@0
|
103 ns-imports ns-interns refer ns-refers alias ns-aliases ns-unalias ns-resolve
|
rlm@0
|
104 resolve ns require use loaded-libs compile intern namespace-munge
|
rlm@0
|
105 ;; Java
|
rlm@0
|
106 .. import class enumeration-seq
|
rlm@0
|
107 ;;Objects
|
rlm@0
|
108 bases make-hierarchy supers isa? parents ancestors descendants derive underive
|
rlm@0
|
109 ;; Symbols
|
rlm@0
|
110 *ns* *1 *2 *3 *e *compile-path*
|
rlm@0
|
111 ;; Proxies
|
rlm@0
|
112 get-proxy-class construct-proxy init-proxy update-proxy proxy-mappings proxy
|
rlm@0
|
113 proxy-super bean
|
rlm@0
|
114 ;; Vars
|
rlm@0
|
115 var-get
|
rlm@0
|
116
|
rlm@0
|
117 ]]]
|
rlm@0
|
118
|
rlm@0
|
119
|
rlm@0
|
120 '[rlm
|
rlm@0
|
121 [function-utils :only [mix defmix runonce]]
|
rlm@0
|
122 [rlm-commands :only [undef ns-reset ns-nuke reload keymap-clojure keymap-normal rlm]]
|
rlm@0
|
123 [ns-rlm :only [ns-clear ns-clone ls]]
|
rlm@0
|
124 [play-all :only [play-all-music]]
|
rlm@0
|
125 [shell-inspect :only [command-line?]]
|
rlm@0
|
126 [shell-write :only [sw]]
|
rlm@0
|
127 [classpath-utils :only [classpath add-to-classpath]]
|
rlm@0
|
128 [dreams :only [megadef megaundef silence]]
|
rlm@0
|
129 [map-utils :only [map-keys map-vals filter-keys filter-vals]]
|
rlm@0
|
130 [decorators :only [preserve-meta]]
|
rlm@0
|
131 [visualize :only [visual]]
|
rlm@0
|
132 [identify :only [identify]]
|
rlm@0
|
133 [push :only [push-gen push]]
|
rlm@0
|
134 ]
|
rlm@0
|
135 '[coderloop
|
rlm@0
|
136 [utils :only [read-integer read-big-integer read-integers trans-print digits]]
|
rlm@0
|
137 [export-files :only [export-archive]]]
|
rlm@0
|
138
|
rlm@0
|
139 '[sunil
|
rlm@0
|
140 [curry :only [decorate curry defn-decorated]]]
|
rlm@0
|
141
|
rlm@0
|
142 '[clojure.contrib
|
rlm@0
|
143 [import-static :only [import-static]]
|
rlm@0
|
144 [combinatorics :only [cartesian-product subsets selections
|
rlm@0
|
145 permutations lex-permutations combinations]]
|
rlm@0
|
146 [duck-streams :only [file-str read-lines]]
|
rlm@0
|
147 [str-utils :only [re-split re-gsub str-join]]
|
rlm@0
|
148 [seq :only [separate indexed rotations find-first positions]]
|
rlm@0
|
149 [math :only [expt round gcd lcm floor ceil]]
|
rlm@0
|
150 [repl-utils :only [show expression-info]]
|
rlm@0
|
151 [def :only [defn-memo defvar defmacro-]]
|
rlm@0
|
152
|
rlm@0
|
153
|
rlm@0
|
154 ]
|
rlm@0
|
155
|
rlm@0
|
156 '[clojure.contrib.generic
|
rlm@0
|
157 [arithmetic :only [+ - / *]]
|
rlm@0
|
158 [collection :only [assoc conj dissoc get empty into seq]]
|
rlm@0
|
159 [comparison :only [pos? neg? zero? > < <= >= max min]]
|
rlm@0
|
160 [math-functions :only
|
rlm@0
|
161 [sqr approx= conjugate sgn acos asin atan atan2
|
rlm@0
|
162 cos exp log pow rint sin tan]]
|
rlm@0
|
163 [functor :only [fmap]]]
|
rlm@0
|
164
|
rlm@0
|
165 '[matchure :only [fn-match defn-match if-match when-match cond-match]]
|
rlm@0
|
166
|
rlm@0
|
167
|
rlm@0
|
168 ;; '[letd :only [with-separator display-local-bindings letd]]
|
rlm@0
|
169
|
rlm@0
|
170 '[clojure
|
rlm@0
|
171 [repl :only [source]]]
|
rlm@0
|
172
|
rlm@0
|
173 '[clojure.java
|
rlm@0
|
174 [javadoc :only [javadoc add-local-javadoc]]]
|
rlm@0
|
175
|
rlm@0
|
176 )
|
rlm@0
|
177
|
rlm@0
|
178 ;;java stuff
|
rlm@0
|
179
|
rlm@0
|
180 (import '[java.lang ProcessBuilder Enum SuppressWarnings Throwable
|
rlm@0
|
181 InterruptedException Thread$UncaughtExceptionHandler RuntimeException
|
rlm@0
|
182 Thread$State ArrayIndexOutOfBoundsException IllegalAccessError Process
|
rlm@0
|
183 SecurityException InstantiationException ThreadGroup System
|
rlm@0
|
184 EnumConstantNotPresentException OutOfMemoryError Double Package
|
rlm@0
|
185 ExceptionInInitializerError RuntimePermission UnknownError
|
rlm@0
|
186 IncompatibleClassChangeError
|
rlm@0
|
187 ArithmeticException StackTraceElement NoSuchFieldError InternalError Thread
|
rlm@0
|
188 SecurityManager Cloneable NegativeArraySizeException StringBuilder Appendable
|
rlm@0
|
189 Byte Math Exception IllegalAccessException ClassNotFoundException
|
rlm@0
|
190 UnsatisfiedLinkError
|
rlm@0
|
191 IllegalArgumentException AssertionError Short StrictMath ClassCircularityError
|
rlm@0
|
192 NoSuchFieldException Comparable Readable UnsupportedClassVersionError
|
rlm@0
|
193 IllegalThreadStateException Iterable Object VirtualMachineError
|
rlm@0
|
194 InheritableThreadLocal
|
rlm@0
|
195 ThreadLocal ClassLoader CloneNotSupportedException TypeNotPresentException
|
rlm@0
|
196 Void
|
rlm@0
|
197 Character NoClassDefFoundError IllegalStateException LinkageError Boolean
|
rlm@0
|
198 String
|
rlm@0
|
199 InstantiationError Float Runnable IndexOutOfBoundsException ClassFormatError
|
rlm@0
|
200 NullPointerException NoSuchMethodError ClassCastException Class
|
rlm@0
|
201 StringIndexOutOfBoundsException Override ThreadDeath CharSequence Number
|
rlm@0
|
202 IllegalMonitorStateException Error NumberFormatException VerifyError
|
rlm@0
|
203 StringBuffer
|
rlm@0
|
204 NoSuchMethodException Long ArrayStoreException UnsupportedOperationException
|
rlm@0
|
205 Integer
|
rlm@0
|
206 Deprecated StackOverflowError AbstractMethodError Runtime]
|
rlm@0
|
207 '[java.math BigDecimal BigInteger]
|
rlm@0
|
208 'java.util.concurrent.Callable
|
rlm@0
|
209 'clojure.lang.Compiler
|
rlm@0
|
210 )
|
rlm@0
|
211
|
rlm@0
|
212 ;; jme3 stuff
|
rlm@0
|
213
|
rlm@0
|
214 (set! clojure.core/*print-length* 20)
|
rlm@0
|
215
|
rlm@0
|
216 (clojure.java.javadoc/add-local-javadoc "/home/r/mobius/temp-clj/javadoc")
|
rlm@0
|
217
|
rlm@0
|
218
|
rlm@0
|
219 (clojure.java.javadoc/add-local-javadoc "/home/r/roBin/jdk6-docs/docs/api")
|
rlm@0
|
220 (clojure.java.javadoc/add-local-javadoc
|
rlm@0
|
221 "/home/r/roBin/lpsolve-doc/lpsolve.sourceforge.net/5.5/Java/docs/api")
|
rlm@0
|
222
|
rlm@0
|
223
|
rlm@0
|
224 (defmethod / [java.lang.Number java.lang.Number]
|
rlm@0
|
225 [x y] (clojure.core// x y))
|
rlm@0
|
226
|
rlm@0
|
227 (defmethod - [java.lang.Number java.lang.Number]
|
rlm@0
|
228 [x y] (clojure.core/- x y))
|
rlm@0
|
229
|
rlm@0
|
230 (import-static java.lang.Math PI E)
|
rlm@0
|
231
|
rlm@0
|
232
|
rlm@0
|
233
|
rlm@0
|
234
|
rlm@0
|
235
|
rlm@0
|
236
|
rlm@0
|
237
|
rlm@0
|
238
|
rlm@0
|
239
|
rlm@0
|
240
|
rlm@0
|
241
|
rlm@0
|
242
|
rlm@0
|
243
|