aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--clojurescript/PersistentVector-proto.js189
-rw-r--r--clojurescript/PersistentVector.js172
-rw-r--r--clojurescript/README.txt22
-rw-r--r--clojurescript/boot.js3155
-rw-r--r--clojurescript/clj.js640
-rw-r--r--clojurescript/t01.html12
-rw-r--r--clojurescript/t02.html12
-rw-r--r--clojurescript/t03.html12
-rw-r--r--clojurescript/t04.html12
-rw-r--r--clojurescript/t05.js (renamed from clojurescript/PersistentVector-test.js)23
-rw-r--r--clojurescript/test.html21
-rw-r--r--clojurescript/tojs.clj3
12 files changed, 3746 insertions, 527 deletions
diff --git a/clojurescript/PersistentVector-proto.js b/clojurescript/PersistentVector-proto.js
deleted file mode 100644
index ef5e93ef..00000000
--- a/clojurescript/PersistentVector-proto.js
+++ /dev/null
@@ -1,189 +0,0 @@
-RT = { EMPTY_ARRAY: [] };
-
-function APersistentVector( _meta ) {
- this._meta = _meta;
-}
-
-APersistentVector.prototype.meta = function() {
- return this._meta;
-};
-
-APersistentVector.prototype.peek = function() {
- if( this.count() > 0 ) {
- return this.nth( this.count() - 1 );
- }
- return null;
-};
-
-function PersistentVector( _meta, cnt, shift, root, tail ) {
- APersistentVector.call( this, _meta );
- this._meta = _meta;
- this.cnt = cnt;
- this.shift = shift;
- this.root = root;
- this.tail = tail;
-}
-
-PersistentVector.prototype = new APersistentVector( null );
-PersistentVector.constructor = PersistentVector;
-
-PersistentVector.prototype.tailoff = function() {
- return this.cnt - this.tail.length;
-};
-
-PersistentVector.prototype.nth = function( i ) {
- if( i >= 0 && i < this.cnt ) {
- if( i >= this.tailoff() ) {
- return this.tail[ i & 0x01f ];
- }
- var arr = this.root;
- for( var level = this.shift; level > 0; level -= 5 ) {
- arr = arr[ (i >>> level) & 0x01f ];
- }
- return arr[ i & 0x01f ];
- }
- throw "IndexOutOfBoundsException";
-};
-
-PersistentVector.prototype.assocN = function( i, val ) {
- if( i >= 0 && i < this.cnt ) {
- if( i >= this.tailoff() ) {
- var newTail = this.tail.slice( 0 );
- newTail[ i & 0x01f ] = val;
- return new PersistentVector(
- this.meta(), this.cnt, this.shift, this.root, newTail );
- }
- return new PersistentVector(
- this.meta(), this.cnt, this.shift,
- this.doAssoc( this.shift, this.root, i, val), this.tail );
- }
- if( i == this.cnt ) {
- return this.cons( val );
- }
- throw "IndexOutOfBoundsException";
-};
-
-PersistentVector.prototype.doAssoc = function( level, arr, i, val ) {
- var ret = arr.slice( 0 );
- if( level == 0 ) {
- ret[ i & 0x01f ] = val;
- }
- else {
- var subidx = (i >>> level) & 0x01f;
- ret[ subidx ] = this.doAssoc( level - 5, arr[ subidx ], i, val );
- }
- return ret;
-};
-
-PersistentVector.prototype.count = function() {
- return this.cnt;
-};
-
-PersistentVector.prototype.withMeta = function( _meta ) {
- return new PersistentVector(
- _meta, this.cnt, this.shift, this.root, this.tail );
-};
-
-PersistentVector.prototype.cons = function( val ) {
- if( this.tail.length < 32 ) {
- var newTail = this.tail.concat( [val] );
- return new PersistentVector(
- this.meta(), this.cnt + 1, this.shift, this.root, newTail );
- }
- var expansion = [null];
- var newroot = this.pushTail( this.shift - 5, this.root, this.tail, expansion);
- var newshift = this.shift;
- if( expansion[0] != null ) {
- newroot = [newroot, expansion[0]];
- newshift += 5;
- }
- return new PersistentVector(
- this.meta(), this.cnt+1, newshift, newroot, [val] );
-};
-
-PersistentVector.prototype.empty = function() {
- return PersistentVector.EMPTY.withMeta( this.meta() );
-};
-
-PersistentVector.prototype.pushTail = function( level, arr, tailNode, expansion)
-{
- var newchild;
- if( level == 0 ) {
- newchild = tailNode;
- }
- else {
- newchild = this.pushTail(
- level - 5, arr[arr.length - 1], tailNode, expansion);
- if( expansion[0] == null ) {
- var ret = arr.slice( 0 );
- ret[ arr.length - 1 ] = newchild;
- return ret;
- }
- else {
- newchild = expansion[0];
- }
- }
- //expansion
- if( arr.length == 32 ) {
- expansion[0] = [newchild];
- return arr;
- }
- expansion[0] = null;
- return arr.concat([newchild]);
-};
-
-PersistentVector.prototype.pop = function() {
- if( this.cnt == 0 ) {
- throw "IllegalStateException: Can't pop empty vector";
- }
- if( this.cnt == 1 ) {
- return PersistentVector.EMPTY.withMeta( this.meta() );
- }
- if( this.tail.length > 1 ) {
- var newTail = this.tail.slice( 0, this.tail.length - 1 );
- return new PersistentVector(
- this.meta(), this.cnt - 1, this.shift, this.root, newTail );
- }
- var ptail = [null];
- var newroot = this.popTail( this.shift - 5, this.root, ptail );
- var newshift = this.shift;
- if( newroot == null ) {
- newroot = RT.EMPTY_ARRAY;
- }
- if( this.shift > 5 && newroot.length == 1 ) {
- newroot = newroot[0];
- newshift -= 5;
- }
- return new PersistentVector(
- this.meta(), this.cnt - 1, newshift, newroot, ptail[0] );
-};
-
-PersistentVector.prototype.popTail = function( shift, arr, ptail ) {
- if( shift > 0 ) {
- var newchild = this.popTail( shift - 5, arr[ arr.length - 1 ], ptail );
- if( newchild != null ) {
- var ret = arr.slice( 0 );
- ret[ arr.length - 1 ] = newchild;
- return ret;
- }
- }
- if( shift == 0 ) {
- ptail[0] = arr[ arr.length - 1 ];
- }
- //contraction
- if( arr.length == 1 ) {
- return null;
- }
- return arr.slice( 0, arr.length - 1 );
-};
-
-PersistentVector.EMPTY = new PersistentVector(
- {}, 0, 5, RT.EMPTY_ARRAY, RT.EMPTY_ARRAY );
-
-PersistentVector.create = function( items ) {
- var ret = PersistentVector.EMPTY;
- for( var i = 0; i < items.length; ++i ) {
- ret = ret.cons( items[ i ] );
- }
- return ret;
-}
diff --git a/clojurescript/PersistentVector.js b/clojurescript/PersistentVector.js
deleted file mode 100644
index 26e60330..00000000
--- a/clojurescript/PersistentVector.js
+++ /dev/null
@@ -1,172 +0,0 @@
-RT = { EMPTY_ARRAY: [] };
-
-function APersistentVector( meta_arg ) {
-
- this.meta = function() {
- return meta_arg;
- };
-
- this.peek = function() {
- if( this.count() > 0 ) {
- return this.nth( this.count() - 1 );
- }
- return null;
- };
-};
-
-function PersistentVector( meta_arg, cnt, shift, root, tail ) {
- APersistentVector.call( this, meta_arg );
-
- function tailoff() {
- return cnt - tail.length;
- };
-
- this.nth = function( i ) {
- if( i >= 0 && i < cnt ) {
- if( i >= tailoff() ) {
- return tail[ i & 0x01f ];
- }
- var arr = root;
- for( var level = shift; level > 0; level -= 5 ) {
- arr = arr[ (i >>> level) & 0x01f ];
- }
- return arr[ i & 0x01f ];
- }
- throw "IndexOutOfBoundsException";
- };
-
- this.assocN = function( i, val ) {
- if( i >= 0 && i < cnt ) {
- if( i >= tailoff() ) {
- var newTail = tail.slice( 0 );
- newTail[ i & 0x01f ] = val;
- return new PersistentVector( this.meta(), cnt, shift, root, newTail );
- }
- return new PersistentVector(
- this.meta(), cnt, shift, doAssoc( shift, root, i, val), tail );
- }
- if( i == cnt ) {
- return this.cons( val );
- }
- throw "IndexOutOfBoundsException";
- };
-
- function doAssoc( level, arr, i, val ) {
- var ret = arr.slice( 0 );
- if( level == 0 ) {
- ret[ i & 0x01f ] = val;
- }
- else {
- var subidx = (i >>> level) & 0x01f;
- ret[ subidx ] = doAssoc( level - 5, arr[ subidx ], i, val );
- }
- return ret;
- };
-
- this.count = function() {
- return cnt;
- };
-
- this.withMeta = function( meta_arg ) {
- return new PersistentVector( meta_arg, cnt, shift, root, tail );
- };
-
- this.cons = function( val ) {
- if( tail.length < 32 ) {
- var newTail = tail.concat( [val] );
- return new PersistentVector( this.meta(), cnt + 1, shift, root, newTail );
- }
- var expansion = [null];
- var newroot = pushTail( shift - 5, root, tail, expansion );
- var newshift = shift;
- if( expansion[0] != null ) {
- newroot = [newroot, expansion[0]];
- newshift += 5;
- }
- return new PersistentVector( this.meta(), cnt+1, newshift, newroot, [val] );
- };
-
- this.empty = function() {
- return PersistentVector.EMPTY.withMeta( this.meta() );
- };
-
- function pushTail( level, arr, tailNode, expansion ) {
- var newchild;
- if( level == 0 ) {
- newchild = tailNode;
- }
- else {
- newchild = pushTail( level - 5, arr[arr.length - 1], tailNode, expansion);
- if( expansion[0] == null ) {
- var ret = arr.slice( 0 );
- ret[ arr.length - 1 ] = newchild;
- return ret;
- }
- else {
- newchild = expansion[0];
- }
- }
- //expansion
- if( arr.length == 32 ) {
- expansion[0] = [newchild];
- return arr;
- }
- expansion[0] = null;
- return arr.concat([newchild]);
- };
-
- this.pop = function() {
- if( cnt == 0 ) {
- throw "IllegalStateException: Can't pop empty vector";
- }
- if( cnt == 1 ) {
- return PersistentVector.EMPTY.withMeta( this.meta() );
- }
- if( tail.length > 1 ) {
- var newTail = tail.slice( 0, tail.length - 1 );
- return new PersistentVector( this.meta(), cnt - 1, shift, root, newTail );
- }
- var ptail = [null];
- var newroot = popTail( shift - 5, root, ptail );
- var newshift = shift;
- if( newroot == null ) {
- newroot = RT.EMPTY_ARRAY;
- }
- if( shift > 5 && newroot.length == 1 ) {
- newroot = newroot[0];
- newshift -= 5;
- }
- return new PersistentVector(
- this.meta(), cnt - 1, newshift, newroot, ptail[0] );
- };
-
- function popTail( shift, arr, ptail ) {
- if( shift > 0 ) {
- var newchild = popTail( shift - 5, arr[ arr.length - 1 ], ptail );
- if( newchild != null ) {
- var ret = arr.slice( 0 );
- ret[ arr.length - 1 ] = newchild;
- return ret;
- }
- }
- if( shift == 0 ) {
- ptail[0] = arr[ arr.length - 1 ];
- }
- //contraction
- if( arr.length == 1 ) {
- return null;
- }
- return arr.slice( 0, arr.length - 1 );
- };
-}
-
-PersistentVector.EMPTY = new PersistentVector(
- {}, 0, 5, RT.EMPTY_ARRAY, RT.EMPTY_ARRAY );
-
-PersistentVector.create = function( items ) {
- var ret = PersistentVector.EMPTY;
- for( var i = 0; i < items.length; ++i ) {
- ret = ret.cons( items[ i ] );
- }
- return ret;
-}
diff --git a/clojurescript/README.txt b/clojurescript/README.txt
index 387a4b7d..089bc276 100644
--- a/clojurescript/README.txt
+++ b/clojurescript/README.txt
@@ -1,17 +1,23 @@
This directory contains work in progress on what may eventually become
-ClojureScript. If it worked, it would allow code written in a subset
-of Clojure to be automatically translated to JavaScript.
+ClojureScript. It currently allows code written in a very small
+subset of Clojure to be automatically translated to JavaScript.
-The .js files are hand-written ports of Java included in Clojure, or
-hand-written tests for the above.
+tojs.clj is Clojure code to translate Clojure forms to Javascript. It
+was used to generate boot.js from clojure's own boot.clj.
-tojs.clj is Clojure code to translate Clojure forms to Javascript.
+To run any of the tests, do something like:
-clojurescript-compiler.patch is a patch file to add features to
-Clojure that are required by tojs.clj.
+java -cp ~/build/clojure/clojure.jar:/home/chouser/proj/clojure-contrib/src
+clojure.lang.Script tojs.clj -- t03.cljs > t03.js
+
+Now that you've got the .js file, you can test using Rhino:
+
+/usr/bin/java -jar /usr/share/java/js.jar -f clj.js -f boot.js -f t03.js
+
+Or point a browser at test.html and choose the test you want to run.
There's plenty more to do. If you'd like to help, contact the Clojure
Google group: clojure@googlegroups.com
--Chouser
-12 Sept 2008
+23 Sept 2008
diff --git a/clojurescript/boot.js b/clojurescript/boot.js
new file mode 100644
index 00000000..0bb23e4a
--- /dev/null
+++ b/clojurescript/boot.js
@@ -0,0 +1,3155 @@
+
+//======
+//(in-ns (quote clojure))
+//---
+(function __tmp_fn_2581(){
+return (clojure.in_ns("'clojure"))})();
+
+//======
+//(def list (. clojure.lang.PersistentList creator))
+//---
+(function __clojure_fn_2590(){
+return (clojure.JS.def(clojure,"list",clojure.lang.PersistentList.creator))})();
+
+//======
+//(def cons (fn* cons [x seq] (. clojure.lang.RT (cons x seq))))
+//---
+(function __clojure_fn_2598(){
+return (clojure.JS.def(clojure,"cons",(function __clojure_fn_2598_cons_2600(x_1,seq_2){
+var cons_0=arguments.callee;
+return (clojure.lang.RT.cons(x_1,seq_2))})))})();
+
+//======
+//(def conj (fn conj ([coll x] (. clojure.lang.RT (conj coll x))) ([coll x & xs] (if xs (recur (conj coll x) (first xs) (rest xs)) (conj coll x)))))
+//---
+(function __clojure_fn_2633(){
+return (clojure.JS.def(clojure,"conj",clojure.JS.variatic(function __clojure_fn_2633_conj_2635(coll_1,x_2){switch(arguments.length){
+case 2:var conj_0=arguments.callee;
+return (clojure.lang.RT.conj(coll_1,x_2))}
+var _cnt,_rtn,xs_3,conj_0=arguments.callee,xs_3=clojure.JS.rest_args(this,arguments,2);
+do{_cnt=0;_rtn=((xs_3)?((_cnt=1,_t0=conj_0(coll_1,x_2),_t1=clojure.first(xs_3),_t2=clojure.rest(xs_3),coll_1=_t0,x_2=_t1,xs_3=_t2)):(conj_0(coll_1,x_2)))
+}while(_cnt);return _rtn;})))})();
+
+//======
+//(def second (fn second [x] (first (rest x))))
+//---
+(function __clojure_fn_2643(){
+return (clojure.JS.def(clojure,"second",(function __clojure_fn_2643_second_2645(x_1){
+var second_0=arguments.callee;
+return (clojure.first(clojure.rest(x_1)))})))})();
+
+//======
+//(def ffirst (fn ffirst [x] (first (first x))))
+//---
+(function __clojure_fn_2653(){
+return (clojure.JS.def(clojure,"ffirst",(function __clojure_fn_2653_ffirst_2655(x_1){
+var ffirst_0=arguments.callee;
+return (clojure.first(clojure.first(x_1)))})))})();
+
+//======
+//(def rfirst (fn rfirst [x] (rest (first x))))
+//---
+(function __clojure_fn_2663(){
+return (clojure.JS.def(clojure,"rfirst",(function __clojure_fn_2663_rfirst_2665(x_1){
+var rfirst_0=arguments.callee;
+return (clojure.rest(clojure.first(x_1)))})))})();
+
+//======
+//(def frest (fn frest [x] (first (rest x))))
+//---
+(function __clojure_fn_2673(){
+return (clojure.JS.def(clojure,"frest",(function __clojure_fn_2673_frest_2675(x_1){
+var frest_0=arguments.callee;
+return (clojure.first(clojure.rest(x_1)))})))})();
+
+//======
+//(def rrest (fn rrest [x] (rest (rest x))))
+//---
+(function __clojure_fn_2683(){
+return (clojure.JS.def(clojure,"rrest",(function __clojure_fn_2683_rrest_2685(x_1){
+var rrest_0=arguments.callee;
+return (clojure.rest(clojure.rest(x_1)))})))})();
+
+//======
+//(def seq? (fn seq? [x] (instance? clojure.lang.ISeq x)))
+//---
+(function __clojure_fn_2703(){
+return (clojure.JS.def(clojure,"seq_QMARK_",(function __clojure_fn_2703_seq_QMARK_2705(x_1){
+var seq_QMARK__0=arguments.callee;
+return (clojure.instance_QMARK_(clojure.lang.ISeq,x_1))})))})();
+
+//======
+//(def string? (fn string? [x] (instance? String x)))
+//---
+(function __clojure_fn_2713(){
+return (clojure.JS.def(clojure,"string_QMARK_",(function __clojure_fn_2713_string_QMARK_2715(x_1){
+var string_QMARK__0=arguments.callee;
+return (clojure.instance_QMARK_(java.lang.String,x_1))})))})();
+
+//======
+//(def map? (fn map? [x] (instance? clojure.lang.IPersistentMap x)))
+//---
+(function __clojure_fn_2723(){
+return (clojure.JS.def(clojure,"map_QMARK_",(function __clojure_fn_2723_map_QMARK_2725(x_1){
+var map_QMARK__0=arguments.callee;
+return (clojure.instance_QMARK_(clojure.lang.IPersistentMap,x_1))})))})();
+
+//======
+//(def vector? (fn vector? [x] (instance? clojure.lang.IPersistentVector x)))
+//---
+(function __clojure_fn_2733(){
+return (clojure.JS.def(clojure,"vector_QMARK_",(function __clojure_fn_2733_vector_QMARK_2735(x_1){
+var vector_QMARK__0=arguments.callee;
+return (clojure.instance_QMARK_(clojure.lang.IPersistentVector,x_1))})))})();
+
+//======
+//(def sigs (fn [fdecl] (if (seq? (first fdecl)) (loop [ret [] fdecl fdecl] (if fdecl (recur (conj ret (first (first fdecl))) (rest fdecl)) (seq ret))) (list (first fdecl)))))
+//---
+(function __clojure_fn_2744(){
+return (clojure.JS.def(clojure,"sigs",(function __clojure_fn_2744_sigs_2746(fdecl_1){
+var ret_2,fdecl_3;
+return (((clojure.seq_QMARK_(clojure.first(fdecl_1)))?(((function __loop(){var _rtn,_cnt;(ret_2=clojure.lang.PersistentVector.EMPTY),
+(fdecl_3=fdecl_1);do{_cnt=0;
+_rtn=((fdecl_3)?((_cnt=1,_t0=clojure.conj(ret_2,clojure.first(clojure.first(fdecl_3))),_t1=clojure.rest(fdecl_3),ret_2=_t0,fdecl_3=_t1)):(clojure.seq(ret_2)))}while(_cnt);return _rtn;})())):(clojure.list(clojure.first(fdecl_1)))))})))})();
+
+//======
+//(def meta (fn meta [x] (if (instance? clojure.lang.IObj x) (. x (meta)))))
+//---
+(function __clojure_fn_2760(){
+return (clojure.JS.def(clojure,"meta",(function __clojure_fn_2760_meta_2762(x_1){
+var meta_0=arguments.callee;
+return (((clojure.instance_QMARK_(clojure.lang.IObj,x_1))?((x_1).meta()):(null)))})))})();
+
+//======
+//(def with-meta (fn with-meta [x m] (. x (withMeta m))))
+//---
+(function __clojure_fn_2770(){
+return (clojure.JS.def(clojure,"with_meta",(function __clojure_fn_2770_with_meta_2772(x_1,m_2){
+var with_meta_0=arguments.callee;
+return ((x_1).withMeta(m_2))})))})();
+
+//======
+//(def last (fn last [s] (if (rest s) (recur (rest s)) (first s))))
+//---
+(function __clojure_fn_2780(){
+return (clojure.JS.def(clojure,"last",(function __clojure_fn_2780_last_2782(s_1){
+var _cnt,_rtn,last_0=arguments.callee;
+do{_cnt=0;_rtn=((clojure.rest(s_1))?((_cnt=1,_t0=clojure.rest(s_1),s_1=_t0)):(clojure.first(s_1)))
+}while(_cnt);return _rtn;})))})();
+
+//======
+//(def butlast (fn butlast [s] (loop [ret [] s s] (if (rest s) (recur (conj ret (first s)) (rest s)) (seq ret)))))
+//---
+(function __clojure_fn_2790(){
+return (clojure.JS.def(clojure,"butlast",(function __clojure_fn_2790_butlast_2792(s_1){
+var s_3,ret_2,butlast_0=arguments.callee;
+return (((function __loop(){var _rtn,_cnt;(ret_2=clojure.lang.PersistentVector.EMPTY),
+(s_3=s_1);do{_cnt=0;
+_rtn=((clojure.rest(s_3))?((_cnt=1,_t0=clojure.conj(ret_2,clojure.first(s_3)),_t1=clojure.rest(s_3),ret_2=_t0,s_3=_t1)):(clojure.seq(ret_2)))}while(_cnt);return _rtn;})()))})))})();
+
+//======
+//(defn cast "Throws a ClassCastException if x is not a c, else returns x." [c x] (. c (cast x)))
+//---
+(function __clojure_fn_2809(){
+return (clojure.JS.def(clojure,"cast",(function __clojure_fn_2809_cast_2811(c_1,x_2){
+return ((c_1).cast(x_2))})))})();
+
+//======
+//(defn to-array "Returns an array of Objects containing the contents of coll, which\n can be any Collection. Maps to java.util.Collection.toArray()." [coll] (. clojure.lang.RT (toArray coll)))
+//---
+(function __clojure_fn_2821(){
+return (clojure.JS.def(clojure,"to_array",(function __clojure_fn_2821_to_array_2823(coll_1){
+return (clojure.lang.RT.toArray(coll_1))})))})();
+
+//======
+//(defn vector "Creates a new vector containing the args." ([] []) ([& args] (. clojure.lang.LazilyPersistentVector (create args))))
+//---
+(function __clojure_fn_2834(){
+return (clojure.JS.def(clojure,"vector",clojure.JS.variatic(function __clojure_fn_2834_vector_2836(){switch(arguments.length){
+case 0:return (clojure.lang.PersistentVector.EMPTY)}
+var args_1,args_1=clojure.JS.rest_args(this,arguments,0);
+return (clojure.lang.LazilyPersistentVector.create(args_1))})))})();
+
+//======
+//(defn vec "Creates a new vector containing the contents of coll." ([coll] (. clojure.lang.LazilyPersistentVector (createOwning (to-array coll)))))
+//---
+(function __clojure_fn_2847(){
+return (clojure.JS.def(clojure,"vec",(function __clojure_fn_2847_vec_2849(coll_1){
+return (clojure.lang.LazilyPersistentVector.createOwning(clojure.to_array(coll_1)))})))})();
+
+//======
+//(defn hash-set "Returns a new hash set with supplied keys." ([] #{}) ([& keys] (. clojure.lang.PersistentHashSet (create keys))))
+//---
+(function __clojure_fn_2867(){
+return (clojure.JS.def(clojure,"hash_set",clojure.JS.variatic(function __clojure_fn_2867_hash_set_2869(){switch(arguments.length){
+case 0:return (clojure.lang.PersistentHashSet.EMPTY)}
+var keys_1,keys_1=clojure.JS.rest_args(this,arguments,0);
+return (clojure.lang.PersistentHashSet.create(keys_1))})))})();
+
+//======
+//(defn sorted-map "keyval => key val\n Returns a new sorted map with supplied mappings." ([& keyvals] (. clojure.lang.PersistentTreeMap (create keyvals))))
+//---
+(function __clojure_fn_2880(){
+return (clojure.JS.def(clojure,"sorted_map",clojure.JS.variatic(function __clojure_fn_2880_sorted_map_2882(){
+var keyvals_1,keyvals_1=clojure.JS.rest_args(this,arguments,0);
+return (clojure.lang.PersistentTreeMap.create(keyvals_1))})))})();
+
+//======
+//(defn sorted-set "Returns a new sorted set with supplied keys." ([& keys] (. clojure.lang.PersistentTreeSet (create keys))))
+//---
+(function __clojure_fn_2892(){
+return (clojure.JS.def(clojure,"sorted_set",clojure.JS.variatic(function __clojure_fn_2892_sorted_set_2894(){
+var keys_1,keys_1=clojure.JS.rest_args(this,arguments,0);
+return (clojure.lang.PersistentTreeSet.create(keys_1))})))})();
+
+//======
+//(defn sorted-map-by "keyval => key val\n Returns a new sorted map with supplied mappings, using the supplied comparator." ([comparator & keyvals] (. clojure.lang.PersistentTreeMap (create comparator keyvals))))
+//---
+(function __clojure_fn_2904(){
+return (clojure.JS.def(clojure,"sorted_map_by",clojure.JS.variatic(function __clojure_fn_2904_sorted_map_by_2906(comparator_1){
+var keyvals_2,keyvals_2=clojure.JS.rest_args(this,arguments,1);
+return (clojure.lang.PersistentTreeMap.create(comparator_1,keyvals_2))})))})();
+
+//======
+//(defn nil? "Returns true if x is nil, false otherwise." {:tag Boolean} [x] (identical? x nil))
+//---
+(function __clojure_fn_2937(){
+return (clojure.JS.def(clojure,"nil_QMARK_",(function __clojure_fn_2937_nil_QMARK_2939(x_1){
+return (clojure.identical_QMARK_(x_1,null))})))})();
+
+//======
+//(defn false? "Returns true if x is the value false, false otherwise." {:tag Boolean} [x] (identical? x false))
+//---
+(function __clojure_fn_2949(){
+return (clojure.JS.def(clojure,"false_QMARK_",(function __clojure_fn_2949_false_QMARK_2951(x_1){
+return (clojure.identical_QMARK_(x_1,false))})))})();
+
+//======
+//(defn true? "Returns true if x is the value true, false otherwise." {:tag Boolean} [x] (identical? x true))
+//---
+(function __clojure_fn_2961(){
+return (clojure.JS.def(clojure,"true_QMARK_",(function __clojure_fn_2961_true_QMARK_2963(x_1){
+return (clojure.identical_QMARK_(x_1,true))})))})();
+
+//======
+//(defn not "Returns true if x is logical false, false otherwise." {:tag Boolean} [x] (if x false true))
+//---
+(function __clojure_fn_2973(){
+return (clojure.JS.def(clojure,"not",(function __clojure_fn_2973_not_2975(x_1){
+return (((x_1)?(false):(true)))})))})();
+
+//======
+//(defn str "With no args, returns the empty string. With one arg x, returns\n x.toString(). (str nil) returns the empty string. With more than\n one arg, returns the concatenation of the str values of the args." {:tag String} ([] "") ([x] (if (nil? x) "" (. x (toString)))) ([x & ys] (loop [sb (new StringBuilder (str x)) more ys] (if more (recur (. sb (append (str (first more)))) (rest more)) (str sb)))))
+//---
+(function __clojure_fn_2987(){
+return (clojure.JS.def(clojure,"str",clojure.JS.variatic(function __clojure_fn_2987_str_2989(x_1){switch(arguments.length){
+case 1:return (((clojure.nil_QMARK_(x_1))?(""):((x_1).toString())))
+case 0:return ("")}
+var more_4,sb_3,ys_2,ys_2=clojure.JS.rest_args(this,arguments,1);
+return (((function __loop(){var _rtn,_cnt;(sb_3=(new java.lang.StringBuilder(clojure.str(x_1)))),
+(more_4=ys_2);do{_cnt=0;
+_rtn=((more_4)?((_cnt=1,_t0=(sb_3).append(clojure.str(clojure.first(more_4))),_t1=clojure.rest(more_4),sb_3=_t0,more_4=_t1)):(clojure.str(sb_3)))}while(_cnt);return _rtn;})()))})))})();
+
+//======
+//(defn symbol "Returns a Symbol with the given namespace and name." ([name] (. clojure.lang.Symbol (intern name))) ([ns name] (. clojure.lang.Symbol (intern ns name))))
+//---
+(function __clojure_fn_3002(){
+return (clojure.JS.def(clojure,"symbol",(function __clojure_fn_3002_symbol_3004(ns_1,name_2){switch(arguments.length){
+case 1:var name_1=arguments[0];
+return (clojure.lang.Symbol.intern(name_1))}
+return (clojure.lang.Symbol.intern(ns_1,name_2))})))})();
+
+//======
+//(defn keyword "Returns a Keyword with the given namespace and name. Do not use :\n in the keyword strings, it will be added automatically." ([name] (. clojure.lang.Keyword (intern nil name))) ([ns name] (. clojure.lang.Keyword (intern ns name))))
+//---
+(function __clojure_fn_3016(){
+return (clojure.JS.def(clojure,"keyword",(function __clojure_fn_3016_keyword_3018(ns_1,name_2){switch(arguments.length){
+case 1:var name_1=arguments[0];
+return (clojure.lang.Keyword.intern(null,name_1))}
+return (clojure.lang.Keyword.intern(ns_1,name_2))})))})();
+
+//======
+//(defn gensym "Returns a new symbol with a unique name. If a prefix string is\n supplied, the name is prefix# where # is some unique number. If\n prefix is not supplied, the prefix is 'G'." ([] (gensym "G__")) ([prefix-string] (. clojure.lang.Symbol (intern (str prefix-string (str (. clojure.lang.RT (nextID))))))))
+//---
+(function __clojure_fn_3030(){
+return (clojure.JS.def(clojure,"gensym",(function __clojure_fn_3030_gensym_3032(prefix_string_1){switch(arguments.length){
+case 0:return (clojure.gensym("G__"))}
+return (clojure.lang.Symbol.intern(clojure.str(prefix_string_1,clojure.str(clojure.lang.RT.nextID()))))})))})();
+
+//======
+//(defn spread {:private true} [arglist] (cond (nil? arglist) nil (nil? (rest arglist)) (seq (first arglist)) :else (cons (first arglist) (spread (rest arglist)))))
+//---
+(function __clojure_fn_3049(){
+return (clojure.JS.def(clojure,"spread",(function __clojure_fn_3049_spread_3051(arglist_1){
+return (((clojure.nil_QMARK_(arglist_1))?(null):(((clojure.nil_QMARK_(clojure.rest(arglist_1)))?(clojure.seq(clojure.first(arglist_1))):(((":else")?(clojure.cons(clojure.first(arglist_1),clojure.spread(clojure.rest(arglist_1)))):(null)))))))})))})();
+
+//======
+//(defn list* "Creates a new list containing the item prepended to more." [item & more] (spread (cons item more)))
+//---
+(function __clojure_fn_3067(){
+return (clojure.JS.def(clojure,"list_STAR_",clojure.JS.variatic(function __clojure_fn_3067_list_STAR_3069(item_1){
+var more_2,more_2=clojure.JS.rest_args(this,arguments,1);
+return (clojure.spread(clojure.cons(item_1,more_2)))})))})();
+
+//======
+//(defn delay? "returns true if x is a Delay created with delay" [x] (instance? clojure.lang.Delay x))
+//---
+(function __clojure_fn_3085(){
+return (clojure.JS.def(clojure,"delay_QMARK_",(function __clojure_fn_3085_delay_QMARK_3087(x_1){
+return (clojure.instance_QMARK_(clojure.lang.Delay,x_1))})))})();
+
+//======
+//(defn force "If x is a Delay, returns the (possibly cached) value of its expression, else returns x" [x] (. clojure.lang.Delay (force x)))
+//---
+(function __clojure_fn_3097(){
+return (clojure.JS.def(clojure,"force",(function __clojure_fn_3097_force_3099(x_1){
+return (clojure.lang.Delay.force(x_1))})))})();
+
+//======
+//(defn fnseq "Returns a seq object whose first is first and whose rest is the\n value produced by calling restfn with no arguments. restfn will be\n called at most once per step in the sequence, e.g. calling rest\n repeatedly on the head of the seq calls restfn once - the value it\n yields is cached." [first restfn] (new clojure.lang.FnSeq first restfn))
+//---
+(function __clojure_fn_3109(){
+return (clojure.JS.def(clojure,"fnseq",(function __clojure_fn_3109_fnseq_3111(first_1,restfn_2){
+return ((new clojure.lang.FnSeq(first_1,restfn_2)))})))})();
+
+//======
+//(defn cache-seq "Given a seq s, returns a lazy seq that will touch each element of s\n at most once, caching the results." [s] (when s (clojure.lang.CachedSeq. s)))
+//---
+(function __clojure_fn_3127(){
+return (clojure.JS.def(clojure,"cache_seq",(function __clojure_fn_3127_cache_seq_3129(s_1){
+return (((s_1)?((new clojure.lang.CachedSeq(s_1))):(null)))})))})();
+
+//======
+//(defn concat "Returns a lazy seq representing the concatenation of\tthe elements in the supplied colls." ([] nil) ([x] (seq x)) ([x y] (if (seq x) (lazy-cons (first x) (concat (rest x) y)) (seq y))) ([x y & zs] (let [cat (fn cat [xys zs] (if (seq xys) (lazy-cons (first xys) (cat (rest xys) zs)) (when zs (recur (first zs) (rest zs)))))] (cat (concat x y) zs))))
+//---
+(function __clojure_fn_3154(){
+return (clojure.JS.def(clojure,"concat",clojure.JS.variatic(function __clojure_fn_3154_concat_3156(x_1,y_2){switch(arguments.length){
+case 2:return (((clojure.seq(x_1))?((new clojure.lang.LazyCons((function __clojure_fn_3154_concat_3156_fn_3161(G__3160_1){switch(arguments.length){
+case 0:return (clojure.first(x_1))}
+return (clojure.concat(clojure.rest(x_1),y_2))})))):(clojure.seq(y_2))))
+case 1:return (clojure.seq(x_1))
+case 0:return (null)}
+var zs_3,cat_4,zs_3=clojure.JS.rest_args(this,arguments,2);
+return (((cat_4=(function __clojure_fn_3154_concat_3156_cat_3166(xys_1,zs_2){
+var _cnt,_rtn,cat_0=arguments.callee;
+do{_cnt=0;_rtn=((clojure.seq(xys_1))?((new clojure.lang.LazyCons((function __clojure_fn_3154_concat_3156_cat_3166_fn_3168(G__3167_1){switch(arguments.length){
+case 0:return (clojure.first(xys_1))}
+return (cat_0(clojure.rest(xys_1),zs_2))})))):(((zs_2)?((_cnt=1,_t0=clojure.first(zs_2),_t1=clojure.rest(zs_2),xys_1=_t0,zs_2=_t1)):(null))))
+}while(_cnt);return _rtn;})),
+cat_4(clojure.concat(x_1,y_2),zs_3)))})))})();
+
+//======
+//(defn = "Equality. Returns true if x equals y, false if not. Same as\n Java x.equals(y) except it also works for nil, and compares\n numbers in a type-independent manner. Clojure's immutable data\n structures define equals() (and thus =) as a value, not an identity,\n comparison." {:inline (fn [x y] (clojure/concat (clojure/list (quote .)) (clojure/list (quote clojure.lang.Util)) (clojure/list (quote clojure/equal)) (clojure/list x) (clojure/list y))), :inline-arities #{2}, :tag Boolean} ([x] true) ([x y] (. clojure.lang.Util (equal x y))) ([x y & more] (if (= x y) (if (rest more) (recur y (first more) (rest more)) (= y (first more))) false)))
+//---
+(function __clojure_fn_3186(){
+return (clojure.JS.def(clojure,"_EQ_",clojure.JS.variatic(function __clojure_fn_3186_EQ_3191(x_1,y_2){switch(arguments.length){
+case 2:return (clojure.lang.Util.equal(x_1,y_2))
+case 1:return (true)}
+var _cnt,_rtn,more_3,more_3=clojure.JS.rest_args(this,arguments,2);
+do{_cnt=0;_rtn=((clojure.lang.Util.equal(x_1,y_2))?(((clojure.rest(more_3))?((_cnt=1,_t0=y_2,_t1=clojure.first(more_3),_t2=clojure.rest(more_3),x_1=_t0,y_2=_t1,more_3=_t2)):(clojure.lang.Util.equal(y_2,clojure.first(more_3))))):(false))
+}while(_cnt);return _rtn;})))})();
+
+//======
+//(defn not= "Same as (not (= obj1 obj2))" {:tag Boolean} ([x] false) ([x y] (not (= x y))) ([x y & more] (not (apply = x y more))))
+//---
+(function __clojure_fn_3205(){
+return (clojure.JS.def(clojure,"not_EQ_",clojure.JS.variatic(function __clojure_fn_3205_not_EQ_3207(x_1,y_2){switch(arguments.length){
+case 2:return (clojure.not(clojure.lang.Util.equal(x_1,y_2)))
+case 1:return (false)}
+var more_3,more_3=clojure.JS.rest_args(this,arguments,2);
+return (clojure.not(clojure.apply(clojure._EQ_,x_1,y_2,more_3)))})))})();
+
+//======
+//(defn compare "Comparator. Returns 0 if x equals y, -1 if x is logically 'less\n than' y, else 1. Same as Java x.compareTo(y) except it also works\n for nil, and compares numbers in a type-independent manner. x must\n implement Comparable" {:inline (fn [x y] (clojure/concat (clojure/list (quote .)) (clojure/list (quote clojure.lang.Util)) (clojure/list (quote clojure/compare)) (clojure/list x) (clojure/list y))), :tag Integer} [x y] (. clojure.lang.Util (compare x y)))
+//---
+(function __clojure_fn_3222(){
+return (clojure.JS.def(clojure,"compare",(function __clojure_fn_3222_compare_3227(x_1,y_2){
+return (clojure.lang.Util.compare(x_1,y_2))})))})();
+
+//======
+//(defn reduce "f should be a function of 2 arguments. If val is not supplied,\n returns the result of applying f to the first 2 items in coll, then\n applying f to that result and the 3rd item, etc. If coll contains no\n items, f must accept no arguments as well, and reduce returns the\n result of calling f with no arguments. If coll has only 1 item, it\n is returned and f is not called. If val is supplied, returns the\n result of applying f to val and the first item in coll, then\n applying f to that result and the 2nd item, etc. If coll contains no\n items, returns val and f is not called." ([f coll] (let [s (seq coll)] (if s (if (instance? clojure.lang.IReduce s) (. s (reduce f)) (reduce f (first s) (rest s))) (f)))) ([f val coll] (let [s (seq coll)] (if (instance? clojure.lang.IReduce s) (. s (reduce f val)) ((fn [f val s] (if s (recur f (f val (first s)) (rest s)) val)) f val s)))))
+//---
+(function __clojure_fn_3259(){
+return (clojure.JS.def(clojure,"reduce",(function __clojure_fn_3259_reduce_3261(f_1,val_2,coll_3){switch(arguments.length){
+case 2:var s_3,coll_2=arguments[1];
+return (((s_3=clojure.seq(coll_2)),
+((s_3)?(((clojure.instance_QMARK_(clojure.lang.IReduce,s_3))?((s_3).reduce(f_1)):(clojure.reduce(f_1,clojure.first(s_3),clojure.rest(s_3))))):(f_1()))))}
+var s_4;
+return (((s_4=clojure.seq(coll_3)),
+((clojure.instance_QMARK_(clojure.lang.IReduce,s_4))?((s_4).reduce(f_1,val_2)):((function __clojure_fn_3259_reduce_3261_fn_3264(f_1,val_2,s_3){
+var _cnt,_rtn;
+do{_cnt=0;_rtn=((s_3)?((_cnt=1,_t0=f_1,_t1=f_1(val_2,clojure.first(s_3)),_t2=clojure.rest(s_3),f_1=_t0,val_2=_t1,s_3=_t2)):(val_2))
+}while(_cnt);return _rtn;})(f_1,val_2,s_4)))))})))})();
+
+//======
+//(defn reverse "Returns a seq of the items in coll in reverse order. Not lazy." [coll] (reduce conj nil coll))
+//---
+(function __clojure_fn_3275(){
+return (clojure.JS.def(clojure,"reverse",(function __clojure_fn_3275_reverse_3277(coll_1){
+return (clojure.reduce(clojure.conj,null,coll_1))})))})();
+
+//======
+//(defn + "Returns the sum of nums. (+) returns 0." {:inline (fn [x y] (clojure/concat (clojure/list (quote .)) (clojure/list (quote clojure.lang.Numbers)) (clojure/list (clojure/concat (clojure/list (quote clojure/add)) (clojure/list x) (clojure/list y))))), :inline-arities #{2}} ([] 0) ([x] (cast Number x)) ([x y] (. clojure.lang.Numbers (add x y))) ([x y & more] (reduce + (+ x y) more)))
+//---
+(function __clojure_fn_3293(){
+return (clojure.JS.def(clojure,"_PLUS_",clojure.JS.variatic(function __clojure_fn_3293_PLUS_3298(x_1,y_2){switch(arguments.length){
+case 2:return (clojure.lang.Numbers.add(x_1,y_2))
+case 1:return (clojure.cast(java.lang.Number,x_1))
+case 0:return (0)}
+var more_3,more_3=clojure.JS.rest_args(this,arguments,2);
+return (clojure.reduce(clojure._PLUS_,clojure.lang.Numbers.add(x_1,y_2),more_3))})))})();
+
+//======
+//(defn * "Returns the product of nums. (*) returns 1." {:inline (fn [x y] (clojure/concat (clojure/list (quote .)) (clojure/list (quote clojure.lang.Numbers)) (clojure/list (clojure/concat (clojure/list (quote clojure/multiply)) (clojure/list x) (clojure/list y))))), :inline-arities #{2}} ([] 1) ([x] (cast Number x)) ([x y] (. clojure.lang.Numbers (multiply x y))) ([x y & more] (reduce * (* x y) more)))
+//---
+(function __clojure_fn_3317(){
+return (clojure.JS.def(clojure,"_STAR_",clojure.JS.variatic(function __clojure_fn_3317_STAR_3322(x_1,y_2){switch(arguments.length){
+case 2:return (clojure.lang.Numbers.multiply(x_1,y_2))
+case 1:return (clojure.cast(java.lang.Number,x_1))
+case 0:return (1)}
+var more_3,more_3=clojure.JS.rest_args(this,arguments,2);
+return (clojure.reduce(clojure._STAR_,clojure.lang.Numbers.multiply(x_1,y_2),more_3))})))})();
+
+//======
+//(defn / "If no denominators are supplied, returns 1/numerator,\n else returns numerator divided by all of the denominators." {:inline (fn [x y] (clojure/concat (clojure/list (quote .)) (clojure/list (quote clojure.lang.Numbers)) (clojure/list (clojure/concat (clojure/list (quote clojure/divide)) (clojure/list x) (clojure/list y))))), :inline-arities #{2}} ([x] (/ 1 x)) ([x y] (. clojure.lang.Numbers (divide x y))) ([x y & more] (reduce / (/ x y) more)))
+//---
+(function __clojure_fn_3340(){
+return (clojure.JS.def(clojure,"_SLASH_",clojure.JS.variatic(function __clojure_fn_3340_SLASH_3345(x_1,y_2){switch(arguments.length){
+case 2:return (clojure.lang.Numbers.divide(x_1,y_2))
+case 1:return (clojure.lang.Numbers.divide(1,x_1))}
+var more_3,more_3=clojure.JS.rest_args(this,arguments,2);
+return (clojure.reduce(clojure._SLASH_,clojure.lang.Numbers.divide(x_1,y_2),more_3))})))})();
+
+//======
+//(defn - "If no ys are supplied, returns the negation of x, else subtracts\n the ys from x and returns the result." {:inline (fn [& args] (clojure/concat (clojure/list (quote .)) (clojure/list (quote clojure.lang.Numbers)) (clojure/list (clojure/concat (clojure/list (quote clojure/minus)) args)))), :inline-arities #{1 2}} ([x] (. clojure.lang.Numbers (minus x))) ([x y] (. clojure.lang.Numbers (minus x y))) ([x y & more] (reduce - (- x y) more)))