summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRich Hickey <richhickey@gmail.com>2008-12-14 20:01:08 +0000
committerRich Hickey <richhickey@gmail.com>2008-12-14 20:01:08 +0000
commitcad4fcf1afe7977b83c3ee2f40521eb38aa33e10 (patch)
treee2108c6eb686d6b94ad2d65cf89d5ed7c4b1fa19 /src
parent044419862707c9a540b8e42faad0f69bc66fe1fd (diff)
Moved to Eclipse Public License - see epl-v10.html or
http://opensource.org/licenses/eclipse-1.0.php
Diffstat (limited to 'src')
-rw-r--r--src/clj/clojure/core.clj4
-rw-r--r--src/clj/clojure/core_print.clj4
-rw-r--r--src/clj/clojure/core_proxy.clj4
-rw-r--r--src/clj/clojure/genclass.clj4
-rw-r--r--src/clj/clojure/inspector.clj4
-rw-r--r--src/clj/clojure/main.clj4
-rw-r--r--src/clj/clojure/parallel.clj4
-rw-r--r--src/clj/clojure/proxy.clj307
-rw-r--r--src/clj/clojure/set.clj4
-rw-r--r--src/clj/clojure/xml.clj4
-rw-r--r--src/clj/clojure/zip.clj4
-rw-r--r--src/jvm/clojure/lang/AFn.java4
-rw-r--r--src/jvm/clojure/lang/AMapEntry.java4
-rw-r--r--src/jvm/clojure/lang/APersistentMap.java4
-rw-r--r--src/jvm/clojure/lang/APersistentSet.java4
-rw-r--r--src/jvm/clojure/lang/APersistentVector.java4
-rw-r--r--src/jvm/clojure/lang/ASeq.java4
-rw-r--r--src/jvm/clojure/lang/Agent.java4
-rw-r--r--src/jvm/clojure/lang/ArraySeq.java4
-rw-r--r--src/jvm/clojure/lang/ArrayStream.java4
-rw-r--r--src/jvm/clojure/lang/Associative.java4
-rw-r--r--src/jvm/clojure/lang/Binding.java4
-rw-r--r--src/jvm/clojure/lang/Box.java4
-rw-r--r--src/jvm/clojure/lang/CachedSeq.java4
-rw-r--r--src/jvm/clojure/lang/Compile.java4
-rw-r--r--src/jvm/clojure/lang/Compiler.java4
-rw-r--r--src/jvm/clojure/lang/Cons.java4
-rw-r--r--src/jvm/clojure/lang/Delay.java4
-rw-r--r--src/jvm/clojure/lang/DynamicClassLoader.java4
-rw-r--r--src/jvm/clojure/lang/EnumerationSeq.java4
-rw-r--r--src/jvm/clojure/lang/Fn.java4
-rw-r--r--src/jvm/clojure/lang/FnSeq.java4
-rw-r--r--src/jvm/clojure/lang/IFn.java4
-rw-r--r--src/jvm/clojure/lang/IMapEntry.java4
-rw-r--r--src/jvm/clojure/lang/IObj.java4
-rw-r--r--src/jvm/clojure/lang/IPersistentCollection.java4
-rw-r--r--src/jvm/clojure/lang/IPersistentList.java4
-rw-r--r--src/jvm/clojure/lang/IPersistentMap.java4
-rw-r--r--src/jvm/clojure/lang/IPersistentSet.java4
-rw-r--r--src/jvm/clojure/lang/IPersistentStack.java4
-rw-r--r--src/jvm/clojure/lang/IPersistentVector.java4
-rw-r--r--src/jvm/clojure/lang/IProxy.java4
-rw-r--r--src/jvm/clojure/lang/IReduce.java4
-rw-r--r--src/jvm/clojure/lang/IRef.java4
-rw-r--r--src/jvm/clojure/lang/ISeq.java4
-rw-r--r--src/jvm/clojure/lang/IStream.java4
-rw-r--r--src/jvm/clojure/lang/IndexedSeq.java4
-rw-r--r--src/jvm/clojure/lang/IteratorSeq.java4
-rw-r--r--src/jvm/clojure/lang/IteratorStream.java4
-rw-r--r--src/jvm/clojure/lang/Keyword.java4
-rw-r--r--src/jvm/clojure/lang/LazilyPersistentVector.java4
-rw-r--r--src/jvm/clojure/lang/LazyCons.java4
-rw-r--r--src/jvm/clojure/lang/LazySeq.java4
-rw-r--r--src/jvm/clojure/lang/LineNumberingPushbackReader.java4
-rw-r--r--src/jvm/clojure/lang/LispReader.java4
-rw-r--r--src/jvm/clojure/lang/LockingTransaction.java4
-rw-r--r--src/jvm/clojure/lang/MapEntry.java4
-rw-r--r--src/jvm/clojure/lang/MultiFn.java4
-rw-r--r--src/jvm/clojure/lang/Named.java4
-rw-r--r--src/jvm/clojure/lang/Namespace.java4
-rw-r--r--src/jvm/clojure/lang/Numbers.java4
-rw-r--r--src/jvm/clojure/lang/Obj.java4
-rw-r--r--src/jvm/clojure/lang/PersistentArrayMap.java4
-rw-r--r--src/jvm/clojure/lang/PersistentHashSet.java4
-rw-r--r--src/jvm/clojure/lang/PersistentList.java4
-rw-r--r--src/jvm/clojure/lang/PersistentQueue.java4
-rw-r--r--src/jvm/clojure/lang/PersistentStructMap.java4
-rw-r--r--src/jvm/clojure/lang/PersistentTreeMap.java4
-rw-r--r--src/jvm/clojure/lang/PersistentTreeSet.java4
-rw-r--r--src/jvm/clojure/lang/ProxyHandler.java4
-rw-r--r--src/jvm/clojure/lang/RT.java4
-rw-r--r--src/jvm/clojure/lang/Range.java4
-rw-r--r--src/jvm/clojure/lang/Ratio.java4
-rw-r--r--src/jvm/clojure/lang/Ref.java4
-rw-r--r--src/jvm/clojure/lang/Reflector.java4
-rw-r--r--src/jvm/clojure/lang/Repl.java4
-rw-r--r--src/jvm/clojure/lang/RestFn.java4
-rw-r--r--src/jvm/clojure/lang/Reversible.java4
-rw-r--r--src/jvm/clojure/lang/Script.java4
-rw-r--r--src/jvm/clojure/lang/SeqEnumeration.java4
-rw-r--r--src/jvm/clojure/lang/SeqIterator.java4
-rw-r--r--src/jvm/clojure/lang/Sequential.java4
-rw-r--r--src/jvm/clojure/lang/Sorted.java4
-rw-r--r--src/jvm/clojure/lang/StreamSeq.java4
-rw-r--r--src/jvm/clojure/lang/Streamable.java4
-rw-r--r--src/jvm/clojure/lang/StringSeq.java4
-rw-r--r--src/jvm/clojure/lang/Symbol.java4
-rw-r--r--src/jvm/clojure/lang/TransactionalHashMap.java4
-rw-r--r--src/jvm/clojure/lang/Util.java4
-rw-r--r--src/jvm/clojure/lang/Var.java4
-rw-r--r--src/jvm/clojure/lang/XMLHandler.java4
91 files changed, 180 insertions, 487 deletions
diff --git a/src/clj/clojure/core.clj b/src/clj/clojure/core.clj
index 8d46be01..fef9d2c1 100644
--- a/src/clj/clojure/core.clj
+++ b/src/clj/clojure/core.clj
@@ -1,7 +1,7 @@
; Copyright (c) Rich Hickey. All rights reserved.
; The use and distribution terms for this software are covered by the
-; Common Public License 1.0 (http://opensource.org/licenses/cpl.php)
-; which can be found in the file CPL.TXT at the root of this distribution.
+; 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.
diff --git a/src/clj/clojure/core_print.clj b/src/clj/clojure/core_print.clj
index b5e9c61e..4dc83cfc 100644
--- a/src/clj/clojure/core_print.clj
+++ b/src/clj/clojure/core_print.clj
@@ -1,7 +1,7 @@
; Copyright (c) Rich Hickey. All rights reserved.
; The use and distribution terms for this software are covered by the
-; Common Public License 1.0 (http://opensource.org/licenses/cpl.php)
-; which can be found in the file CPL.TXT at the root of this distribution.
+; 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.
diff --git a/src/clj/clojure/core_proxy.clj b/src/clj/clojure/core_proxy.clj
index c47d0d0b..8a777347 100644
--- a/src/clj/clojure/core_proxy.clj
+++ b/src/clj/clojure/core_proxy.clj
@@ -1,7 +1,7 @@
; Copyright (c) Rich Hickey. All rights reserved.
; The use and distribution terms for this software are covered by the
-; Common Public License 1.0 (http://opensource.org/licenses/cpl.php)
-; which can be found in the file CPL.TXT at the root of this distribution.
+; 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.
diff --git a/src/clj/clojure/genclass.clj b/src/clj/clojure/genclass.clj
index 98e32068..e293fe0e 100644
--- a/src/clj/clojure/genclass.clj
+++ b/src/clj/clojure/genclass.clj
@@ -1,7 +1,7 @@
; Copyright (c) Rich Hickey. All rights reserved.
; The use and distribution terms for this software are covered by the
-; Common Public License 1.0 (http://opensource.org/licenses/cpl.php)
-; which can be found in the file CPL.TXT at the root of this distribution.
+; 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.
diff --git a/src/clj/clojure/inspector.clj b/src/clj/clojure/inspector.clj
index 0eae58e7..4e1ac077 100644
--- a/src/clj/clojure/inspector.clj
+++ b/src/clj/clojure/inspector.clj
@@ -1,7 +1,7 @@
; Copyright (c) Rich Hickey. All rights reserved.
; The use and distribution terms for this software are covered by the
-; Common Public License 1.0 (http://opensource.org/licenses/cpl.php)
-; which can be found in the file CPL.TXT at the root of this distribution.
+; 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.
diff --git a/src/clj/clojure/main.clj b/src/clj/clojure/main.clj
index fb9f8645..52b49eff 100644
--- a/src/clj/clojure/main.clj
+++ b/src/clj/clojure/main.clj
@@ -1,7 +1,7 @@
;; Copyright (c) Rich Hickey All rights reserved. The use and
;; distribution terms for this software are covered by the Common Public
-;; License 1.0 (http://opensource.org/licenses/cpl.php) which can be found
-;; in the file CPL.TXT at the root of this distribution. By using this
+;; 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.
diff --git a/src/clj/clojure/parallel.clj b/src/clj/clojure/parallel.clj
index ae177b2f..93c119ff 100644
--- a/src/clj/clojure/parallel.clj
+++ b/src/clj/clojure/parallel.clj
@@ -1,7 +1,7 @@
; Copyright (c) Rich Hickey. All rights reserved.
; The use and distribution terms for this software are covered by the
-; Common Public License 1.0 (http://opensource.org/licenses/cpl.php)
-; which can be found in the file CPL.TXT at the root of this distribution.
+; 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.
diff --git a/src/clj/clojure/proxy.clj b/src/clj/clojure/proxy.clj
deleted file mode 100644
index b1491adb..00000000
--- a/src/clj/clojure/proxy.clj
+++ /dev/null
@@ -1,307 +0,0 @@
-; Copyright (c) Rich Hickey. All rights reserved.
-; The use and distribution terms for this software are covered by the
-; Common Public License 1.0 (http://opensource.org/licenses/cpl.php)
-; which can be found in the file CPL.TXT 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.
-
-(in-ns 'clojure.core)
-
-(import
- '(clojure.asm ClassWriter ClassVisitor Opcodes Type)
- '(java.lang.reflect Modifier Constructor)
- '(clojure.asm.commons Method GeneratorAdapter)
- '(clojure.lang IProxy Reflector DynamicClassLoader IPersistentMap PersistentHashMap RT))
-
-(def *proxy-classes* (ref {}))
-
-(defn method-sig [#^java.lang.reflect.Method meth]
- [(. meth (getName)) (seq (. meth (getParameterTypes))) (. meth getReturnType)])
-
-(defn get-proxy-class
- "Takes an optional single class followed by zero or more
- interfaces. If not supplied class defaults to Object. Creates an
- returns an instance of a proxy class derived from the supplied
- classes. The resulting value is cached and used for any subsequent
- requests for the same class set. Returns a Class object."
- [& bases]
- (let [bases (if (. (first bases) (isInterface))
- (cons Object bases)
- bases)
- [super & interfaces] bases]
- (or (get @*proxy-classes* bases)
- (let [cv (new ClassWriter (. ClassWriter COMPUTE_MAXS))
- cname (str "clojure/lang/" (gensym "Proxy__"))
- ctype (. Type (getObjectType cname))
- iname (fn [c] (.. Type (getType c) (getInternalName)))
- fmap "__clojureFnMap"
- totype (fn [c] (. Type (getType c)))
- to-types (fn [cs] (if (pos? (count cs))
- (into-array (map totype cs))
- (make-array Type 0)))
- super-type (totype super)
- map-type (totype PersistentHashMap)
- ifn-type (totype clojure.lang.IFn)
- obj-type (totype Object)
- sym-type (totype clojure.lang.Symbol)
- rt-type (totype clojure.lang.RT)
- ex-type (totype java.lang.UnsupportedOperationException)
- gen-method
- (fn [#^java.lang.reflect.Method meth else-gen]
- (let [pclasses (. meth (getParameterTypes))
- ptypes (to-types pclasses)
- rtype (totype (. meth (getReturnType)))
- m (new Method (. meth (getName)) rtype ptypes)
- gen (new GeneratorAdapter (. Opcodes ACC_PUBLIC) m nil nil cv)
- else-label (. gen (newLabel))
- end-label (. gen (newLabel))
- decl-type (. Type (getType (. meth (getDeclaringClass))))]
- (. gen (visitCode))
- (. gen (loadThis))
- (. gen (getField ctype fmap map-type))
- ;get symbol corresponding to name
- (. gen (push (. meth (getName))))
- (. gen (invokeStatic sym-type (. Method (getMethod "clojure.lang.Symbol create(String)"))))
- ;lookup fn in map
- (. gen (invokeStatic rt-type (. Method (getMethod "Object get(Object, Object)"))))
- (. gen (dup))
- (. gen (ifNull else-label))
- ;if found
- (. gen (loadThis))
- ;box args
- (dotimes [i (count ptypes)]
- (. gen (loadArg i))
- (. clojure.lang.Compiler$HostExpr (emitBoxReturn nil gen (nth pclasses i))))
- ;call fn
- (. gen (invokeInterface ifn-type (new Method "invoke" obj-type
- (into-array (cons obj-type
- (replicate (count ptypes) obj-type))))))
- ;unbox return
- (. gen (unbox rtype))
- (when (= (. rtype (getSort)) (. Type VOID))
- (. gen (pop)))
- (. gen (goTo end-label))
-
- ;else call supplied alternative generator
- (. gen (mark else-label))
- (. gen (pop))
-
- (else-gen gen m)
-
- (. gen (mark end-label))
- (. gen (returnValue))
- (. gen (endMethod))))]
-
- ;start class definition
- (. cv (visit (. Opcodes V1_5) (+ (. Opcodes ACC_PUBLIC) (. Opcodes ACC_SUPER))
- cname nil (iname super)
- (into-array (map iname (cons IProxy interfaces)))))
- ;add field for fn mappings
- (. cv (visitField (+ (. Opcodes ACC_PRIVATE) (. Opcodes ACC_VOLATILE))
- fmap (. map-type (getDescriptor)) nil nil))
- ;add ctors matching/calling super's
- (doseq [#^Constructor ctor (. super (getDeclaredConstructors))]
- (when-not (. Modifier (isPrivate (. ctor (getModifiers))))
- (let [ptypes (to-types (. ctor (getParameterTypes)))
- m (new Method "<init>" (. Type VOID_TYPE) ptypes)
- gen (new GeneratorAdapter (. Opcodes ACC_PUBLIC) m nil nil cv)]
- (. gen (visitCode))
- ;call super ctor
- (. gen (loadThis))
- (. gen (dup))
- (. gen (loadArgs))
- (. gen (invokeConstructor super-type m))
- ;init fmap
- (. gen (getStatic map-type "EMPTY" map-type))
- (. gen (putField ctype fmap map-type))
-
- (. gen (returnValue))
- (. gen (endMethod)))))
- ;add IProxy methods
- (let [m (. Method (getMethod "void __updateClojureFnMappings(clojure.lang.IPersistentMap)"))
- gen (new GeneratorAdapter (. Opcodes ACC_PUBLIC) m nil nil cv)]
- (. gen (visitCode))
- (. gen (loadThis))
- (. gen (dup))
- (. gen (getField ctype fmap map-type))
- (. gen (loadArgs))
- (. gen (invokeInterface (totype clojure.lang.IPersistentCollection)
- (. Method (getMethod "clojure.lang.IPersistentCollection cons(Object)"))))
- (. gen (checkCast map-type))
- (. gen (putField ctype fmap map-type))
-
- (. gen (returnValue))
- (. gen (endMethod)))
- (let [m (. Method (getMethod "clojure.lang.IPersistentMap __getClojureFnMappings()"))
- gen (new GeneratorAdapter (. Opcodes ACC_PUBLIC) m nil nil cv)]
- (. gen (visitCode))
- (. gen (loadThis))
- (. gen (getField ctype fmap map-type))
- (. gen (returnValue))
- (. gen (endMethod)))
-
- ;calc set of supers' non-private instance methods
- (let [mm (loop [mm {} considered #{} c super]
- (if c
- (let [[mm considered]
-