aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--clojurescript/README.txt18
-rw-r--r--clojurescript/src/clojure/contrib/clojurescript.clj (renamed from clojurescript/tojs.clj)122
-rw-r--r--clojurescript/src/clojure/contrib/clojurescript/cli.clj95
-rw-r--r--clojurescript/src/clojure/contrib/clojurescript/core.js (renamed from clojurescript/core.js)2655
-rw-r--r--clojurescript/src/clojure/contrib/clojurescript/repl/blank.gif (renamed from clojurescript/repl/blank.gif)bin48 -> 48 bytes
-rw-r--r--clojurescript/src/clojure/contrib/clojurescript/repl/clojure-logo-anim-03.gif (renamed from clojurescript/repl/clojure-logo-anim-03.gif)bin4919 -> 4919 bytes
-rw-r--r--clojurescript/src/clojure/contrib/clojurescript/repl/dots.png (renamed from clojurescript/repl/dots.png)bin437 -> 437 bytes
-rw-r--r--clojurescript/src/clojure/contrib/clojurescript/repl/repl.cljs (renamed from clojurescript/repl/repl.cljs)0
-rw-r--r--clojurescript/src/clojure/contrib/clojurescript/repl/repl.html (renamed from clojurescript/repl/repl.html)0
-rw-r--r--clojurescript/src/clojure/contrib/clojurescript/repl/repl.js (renamed from clojurescript/repl/repl.js)59
-rw-r--r--clojurescript/src/clojure/contrib/clojurescript/rt.js (renamed from clojurescript/rt.js)10
-rw-r--r--clojurescript/support-for-clojurescript.patch248
-rw-r--r--clojurescript/tests/t01.cljs (renamed from clojurescript/t01.cljs)0
-rw-r--r--clojurescript/tests/t02.cljs (renamed from clojurescript/t02.cljs)0
-rw-r--r--clojurescript/tests/t03.cljs (renamed from clojurescript/t03.cljs)0
-rw-r--r--clojurescript/tests/t04.cljs (renamed from clojurescript/t04.cljs)0
-rw-r--r--clojurescript/tests/t05.js (renamed from clojurescript/t05.js)0
-rw-r--r--clojurescript/tests/t06.cljs (renamed from clojurescript/t06.cljs)0
18 files changed, 1685 insertions, 1522 deletions
diff --git a/clojurescript/README.txt b/clojurescript/README.txt
index 5fe80972..8b38a2aa 100644
--- a/clojurescript/README.txt
+++ b/clojurescript/README.txt
@@ -4,21 +4,23 @@ subset of Clojure to be automatically translated to JavaScript.
tojs.clj is Clojure code to translate Clojure forms to Javascript. It
was used to generate core.js from clojure's own core.clj and
-core-print.clj.
+core_print.clj.
-To run any of the tests, do something like:
+To run any of the tests from the command line, do something like:
-java -cp ~/build/clojure/clojure.jar:/home/chouser/proj/clojure-contrib/src
-clojure.lang.Script tojs.clj -- t03.cljs > t03.js
+java -cp ~/build/clojure/clojure.jar:/home/chouser/proj/clojure-contrib/src:src \
+ clojure.main src/clojure/contrib/clojurescript/cli.clj -- \
+ tests/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 rt.js -f core.js -f t03.js
-
-Or point a browser at test.html and choose the test you want to run.
+/usr/bin/java -jar /usr/share/java/js.jar \
+ -f src/clojure/contrib/clojurescript/rt.js \
+ -f src/clojure/contrib/clojurescript/core.js \
+ -f t03.js
There's plenty more to do. If you'd like to help, contact the Clojure
Google group: clojure@googlegroups.com
--Chouser
-23 Sept 2008
+12 Jan 2009
diff --git a/clojurescript/tojs.clj b/clojurescript/src/clojure/contrib/clojurescript.clj
index 8c9f9e4d..66e7eac3 100644
--- a/clojurescript/tojs.clj
+++ b/clojurescript/src/clojure/contrib/clojurescript.clj
@@ -1,23 +1,19 @@
-; Copyright (c) Chris Houser, Sep 2008. All rights reserved.
+; Copyright (c) Chris Houser, Sep 2008-Jan 2009. 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.
; Reads Clojure code and emits equivalent JavaScript
-(ns clojurescript.tojs
- (:import (clojure.lang Compiler Compiler$C Compiler$BodyExpr
- Compiler$DefExpr Compiler$InstanceMethodExpr)
- (java.io BufferedReader InputStreamReader StringReader PrintWriter)
- (java.net URLDecoder))
- (:use [clojure.contrib.command-line :only (with-command-line)])
- (:require (clojure.contrib [duck-streams :as ds]
- [seq-utils :as su])))
+(ns clojure.contrib.clojurescript
+ (:import (clojure.lang Compiler Compiler$C Compiler$BodyExpr
+ Compiler$DefExpr Compiler$InstanceMethodExpr))
+ (:require [clojure.contrib.duck-streams :as ds]))
-(defn vstr [v]
+(defn- vstr [v]
(let [sb (StringBuilder.)
lvl (fn lvl [v]
(doseq [i v]
@@ -35,9 +31,9 @@
(def *has-recur*)
(def *local-names* {})
-(defmulti tojs (fn [e ctx] (class e)))
+(defmulti #^{:private true} tojs (fn [e ctx] (class e)))
-(defn fnmethod [fm maxm ctx]
+(defn- fnmethod [fm maxm ctx]
(let [lm (into {} (for [[lb lb] (.locals fm)]
[lb (str (.name lb) "_" (.idx lb))]))
thisfn (first (filter #(= 0 (.idx %)) (keys lm)))
@@ -123,7 +119,7 @@
(vec (interpose "," (map #(tojs % ctx) (.args e))))
"])"]))
-(defn const-str [c]
+(defn- const-str [c]
(cond
(or (instance? Character c)
(string? c)) (pr-str (str c))
@@ -144,13 +140,13 @@
(def js-reserved '#{import boolean short byte char class})
-(defn var-munge [x]
+(defn- var-munge [x]
(let [n (-> x str Compiler/munge (.replace "." "_DOT_"))]
(if (js-reserved (symbol n))
(str n "_")
n)))
-(defn var-parts [e]
+(defn- var-parts [e]
(let [{:keys [name ns]} ^(.var e)]
[(Compiler/munge (str (.getName ns))) (var-munge name)]))
@@ -333,9 +329,13 @@
(= "setMacro" (.methodName (second (.exprs mainexpr))))))
(tojs expr {:localmap {}})))))))
-(defn filetojs [filename]
- (let [reader (java.io.PushbackReader. (ds/reader filename))]
- (binding [*ns* (create-ns 'user)]
+(defn filetojs [filename & optseq]
+ (let [reader (java.io.PushbackReader. (ds/reader filename))
+ opts (apply array-map optseq)]
+ (binding [*ns* (create-ns 'user)
+ *debug-fn-names* (:debug-fn-names opts true)
+ *debug-comments* (:debug-comments opts true)
+ *eval-defmacro* (:eval-defmacro opts true)]
(loop []
(let [f (read reader false reader false)]
(when-not (identical? f reader)
@@ -355,85 +355,3 @@
(print "// Skipping: ")
(prn f)))
(recur)))))))
-
-(defn simple-tests []
- (println (formtojs
- '(defn foo
- ([a b c & d] (prn 3 a b c))
- ([c]
- ;(String/asd "hello")
- ;(.foo 55)
- (let [[a b] [1 2]]
- (prn a b c)
- "hi")))))
-
- (println (formtojs
- '(defn foo [a]
- (prn "hi")
- (let [a 5]
- (let [a 10]
- (prn "yo")
- (prn a))
- (prn a))
- (prn a))))
-
- (println (formtojs
- '(defn x [] (conj [] (loop [i 5] (if (pos? i) (recur (- i 2)) i))))))
-
- ;(println (formtojs '(binding [*out* 5] (set! *out* 10))))
- (println (formtojs '(.replace "a/b/c" "/" ".")))
- (println (formtojs '(.getName ":foo")))
- (println (formtojs '(list '(1 "str" 'sym :key) 4 "str2" 6 #{:set 9 8})))
- (println (formtojs '(fn forever[] (forever))))
- (println (formtojs '(fn forever[] (loop [] (recur))))))
-
-(defn start-server [port]
- ;(println "Opening port" port)
- (loop [server (java.net.ServerSocket. port)] ; should bind only to 127.0.0.1
- (send-off (agent (.accept server))
- (fn [socket]
- (with-open [socket socket]
- (binding [*debug-fn-names* false
- *debug-comments* false
- *eval-defmacro* false
- *out* (-> socket .getOutputStream ds/writer)]
- (try
- (print "HTTP/1.0 200 OK\nContent-Type: text/javascript\n\n")
- (let [line1 (-> socket .getInputStream ds/reader .readLine)
- [_ url] (re-find #"^GET /\?(.*?) HTTP" line1)
- codestr (URLDecoder/decode url)
- js (with-out-str (filetojs (StringReader. codestr)))]
- (println "jsrepl.state('compiled');try{")
- (println "jsrepl.lastval=" js )
- (println "jsrepl.state('done');}catch(e){jsrepl.err(e)};"))
- (catch Exception e
- (if (= (.getMessage e) "EOF while reading")
- (println "jsrepl.state('incomplete');")
- (let [trace (with-out-str
- (.printStackTrace e (PrintWriter. *out*)))]
- (println "jsrepl.state('error',\""
- (.replace trace "\n" "\\n") "\");")))))))))
- (recur server)))
-
-(defn mkcore []
- (binding [*out* (ds/writer "core.js")]
- (doseq [file ["clojure/core.clj" "clojure/core-print.clj"]]
- (filetojs (.getResourceAsStream (clojure.lang.RT/baseLoader) file)))))
-
-(defn -main [& args]
- (with-command-line args
- "tojs -- Compile ClojureScript to JavaScript"
- [[simple? "Runs some simple built-in tests"]
- [serve "Starts a repl server on the given port" 8081]
- [mkcore? "Generates a core.js file"]
- [v? "Includes extra fn names and comments in js"]
- filenames]
- (binding [*debug-fn-names* v? *debug-comments* v?]
- (cond
- simple? (simple-tests)
- serve (start-server (Integer/parseInt serve))
- mkcore? (mkcore)
- :else (doseq [filename filenames]
- (filetojs filename))))))
-
-;(when-not *compile-files* (apply -main *command-line-args*))
diff --git a/clojurescript/src/clojure/contrib/clojurescript/cli.clj b/clojurescript/src/clojure/contrib/clojurescript/cli.clj
new file mode 100644
index 00000000..da823b75
--- /dev/null
+++ b/clojurescript/src/clojure/contrib/clojurescript/cli.clj
@@ -0,0 +1,95 @@
+; Copyright (c) Chris Houser, Sep 2008-Jan 2009. All rights reserved.
+; The use and distribution terms for this software are covered by the
+; 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.
+
+; Command Line Interface for generating JavaScript from Clojure code.
+
+(ns clojure.contrib.clojurescript.cli
+ (:import (java.io PrintWriter StringReader)
+ (java.net URLDecoder))
+ (:use [clojure.contrib.command-line :only (with-command-line)]
+ [clojure.contrib.clojurescript :only (formtojs filetojs)])
+ (:require [clojure.contrib.duck-streams :as ds]))
+
+(defn start-server [port]
+ ;(println "Opening port" port)
+ (loop [server (java.net.ServerSocket. port)] ; TODO bind only to 127.0.0.1
+ (send-off (agent (.accept server))
+ (fn [socket]
+ (with-open [socket socket]
+ (binding [*out* (-> socket .getOutputStream ds/writer)]
+ (try
+ (print "HTTP/1.0 200 OK\nContent-Type: text/javascript\n\n")
+ (let [line1 (-> socket .getInputStream ds/reader .readLine)
+ [_ url] (re-find #"^GET /\?(.*?) HTTP" line1)
+ codestr (URLDecoder/decode url)
+ js (with-out-str (filetojs (StringReader. codestr)
+ :debug-fn-names false
+ :debug-comments false
+ :eval-defmacro false))]
+ (println "jsrepl.state('compiled');try{")
+ (println "jsrepl.lastval=" js )
+ (println "jsrepl.state('done');}catch(e){jsrepl.err(e)};"))
+ (catch Exception e
+ (if (= (.getMessage e) "EOF while reading")
+ (println "jsrepl.state('incomplete');")
+ (let [trace (with-out-str
+ (.printStackTrace e (PrintWriter. *out*)))]
+ (println "jsrepl.state('error',\""
+ (.replace trace "\n" "\\n") "\");")))))))))
+ (recur server)))
+
+(defn mkcore []
+ (binding [*out* (ds/writer "core.js")]
+ (doseq [file ["clojure/core.clj" "clojure/core_print.clj"]]
+ (filetojs (.getResourceAsStream (clojure.lang.RT/baseLoader) file)))))
+
+(defn simple-tests []
+ (println (formtojs
+ '(defn foo
+ ([a b c & d] (prn 3 a b c))
+ ([c]
+ ;(String/asd "hello")
+ ;(.foo 55)
+ (let [[a b] [1 2]]
+ (prn a b c)
+ "hi")))))
+
+ (println (formtojs
+ '(defn foo [a]
+ (prn "hi")
+ (let [a 5]
+ (let [a 10]
+ (prn "yo")
+ (prn a))
+ (prn a))
+ (prn a))))
+
+ (println (formtojs
+ '(defn x [] (conj [] (loop [i 5] (if (pos? i) (recur (- i 2)) i))))))
+
+ ;(println (formtojs '(binding [*out* 5] (set! *out* 10))))
+ (println (formtojs '(.replace "a/b/c" "/" ".")))
+ (println (formtojs '(.getName ":foo")))
+ (println (formtojs '(list '(1 "str" 'sym :key) 4 "str2" 6 #{:set 9 8})))
+ (println (formtojs '(fn forever[] (forever))))
+ (println (formtojs '(fn forever[] (loop [] (recur))))))
+
+(when-not *compile-files*
+ (with-command-line *command-line-args*
+ "clojurescript.cli -- Compile ClojureScript to JavaScript"
+ [[simple? "Runs some simple built-in tests"]
+ [serve "Starts a repl server on the given port" 8081]
+ [mkcore? "Generates a core.js file"]
+ [v? "Includes extra fn names and comments in js"]
+ filenames]
+ (cond
+ simple? (simple-tests)
+ serve (start-server (Integer/parseInt serve))
+ mkcore? (mkcore)
+ :else (doseq [filename filenames]
+ (filetojs filename :debug-fn-names v? :debug-comments v?)))))
diff --git a/clojurescript/core.js b/clojurescript/src/clojure/contrib/clojurescript/core.js
index 1542d3f2..7726b43f 100644
--- a/clojurescript/core.js
+++ b/clojurescript/src/clojure/contrib/clojurescript/core.js
@@ -1,14 +1,20 @@
//======
-//(in-ns (quote clojure.core))
+//(ns clojure.core)
//---
-(function __user_fn_2(){
+(function __user_fn_538(){
return (clojure.core.in_ns.apply(null,[clojure.core.symbol("clojure.core")]))}).apply(null,[]);
//======
+//(def unquote)
+//---
+(function __clojure_core_fn_544(){
+return (clojure.JS.def(clojure.core,"unquote",null))}).apply(null,[]);
+
+//======
//(def list (. clojure.lang.PersistentList creator))
//---
-(function __clojure_core_fn_8(){
+(function __clojure_core_fn_547(){
return (clojure.JS.def(clojure.core,"list",clojure.JS.getOrRun(clojure.lang.PersistentList,"creator")))}).apply(null,[]);
// Skipping: (def cons (fn* cons [x seq] (. clojure.lang.RT (cons x seq))))
// Skipping: (def let (fn* let [& decl] (cons (quote let*) decl)))
@@ -20,8 +26,8 @@ return (clojure.JS.def(clojure.core,"list",clojure.JS.getOrRun(clojure.lang.Pers
//======
//(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_core_fn_41(){
-return (clojure.JS.def(clojure.core,"conj",clojure.JS.variadic(2,(function __clojure_core_fn_41_conj_43(coll_1,x_2){switch(arguments.length){
+(function __clojure_core_fn_580(){
+return (clojure.JS.def(clojure.core,"conj",clojure.JS.variadic(2,(function __clojure_core_fn_580_conj_582(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,conj_0=arguments.callee,xs_3=clojure.JS.rest_args(this,arguments,2);
@@ -31,40 +37,40 @@ do{_cnt=0;_rtn=((xs_3)?((_cnt=1,_rtn=[conj_0.apply(null,[coll_1,x_2]),clojure.co
//======
//(def second (fn second [x] (first (rest x))))
//---
-(function __clojure_core_fn_46(){
-return (clojure.JS.def(clojure.core,"second",(function __clojure_core_fn_46_second_48(x_1){
+(function __clojure_core_fn_585(){
+return (clojure.JS.def(clojure.core,"second",(function __clojure_core_fn_585_second_587(x_1){
var second_0=arguments.callee;
return (clojure.core.first.apply(null,[clojure.core.rest.apply(null,[x_1])]))})))}).apply(null,[]);
//======
//(def ffirst (fn ffirst [x] (first (first x))))
//---
-(function __clojure_core_fn_51(){
-return (clojure.JS.def(clojure.core,"ffirst",(function __clojure_core_fn_51_ffirst_53(x_1){
+(function __clojure_core_fn_590(){
+return (clojure.JS.def(clojure.core,"ffirst",(function __clojure_core_fn_590_ffirst_592(x_1){
var ffirst_0=arguments.callee;
return (clojure.core.first.apply(null,[clojure.core.first.apply(null,[x_1])]))})))}).apply(null,[]);
//======
//(def rfirst (fn rfirst [x] (rest (first x))))
//---
-(function __clojure_core_fn_56(){
-return (clojure.JS.def(clojure.core,"rfirst",(function __clojure_core_fn_56_rfirst_58(x_1){
+(function __clojure_core_fn_595(){
+return (clojure.JS.def(clojure.core,"rfirst",(function __clojure_core_fn_595_rfirst_597(x_1){
var rfirst_0=arguments.callee;
return (clojure.core.rest.apply(null,[clojure.core.first.apply(null,[x_1])]))})))}).apply(null,[]);
//======
//(def frest (fn frest [x] (first (rest x))))
//---
-(function __clojure_core_fn_61(){
-return (clojure.JS.def(clojure.core,"frest",(function __clojure_core_fn_61_frest_63(x_1){
+(function __clojure_core_fn_600(){
+return (clojure.JS.def(clojure.core,"frest",(function __clojure_core_fn_600_frest_602(x_1){
var frest_0=arguments.callee;
return (clojure.core.first.apply(null,[clojure.core.rest.apply(null,[x_1])]))})))}).apply(null,[]);
//======
//(def rrest (fn rrest [x] (rest (rest x))))
//---
-(function __clojure_core_fn_66(){
-return (clojure.JS.def(clojure.core,"rrest",(function __clojure_core_fn_66_rrest_68(x_1){
+(function __clojure_core_fn_605(){
+return (clojure.JS.def(clojure.core,"rrest",(function __clojure_core_fn_605_rrest_607(x_1){
var rrest_0=arguments.callee;
return (clojure.core.rest.apply(null,[clojure.core.rest.apply(null,[x_1])]))})))}).apply(null,[]);
// Skipping: (def seq (fn seq [coll] (. clojure.lang.RT (seq coll))))
@@ -73,8 +79,8 @@ return (clojure.core.rest.apply(null,[clojure.core.rest.apply(null,[x_1])]))})))
//======
//(def seq? (fn seq? [x] (instance? clojure.lang.ISeq x)))
//---
-(function __clojure_core_fn_81(){
-return (clojure.JS.def(clojure.core,"seq_QMARK_",(function __clojure_core_fn_81_seq_QMARK_83(x_1){
+(function __clojure_core_fn_620(){
+return (clojure.JS.def(clojure.core,"seq_QMARK_",(function __clojure_core_fn_620_seq_QMARK_622(x_1){
var seq_QMARK__0=arguments.callee;
return (clojure.core.instance_QMARK_.apply(null,[clojure.lang.ISeq,x_1]))})))}).apply(null,[]);
// Skipping: (def string? (fn string? [x] (instance? String x)))
@@ -82,51 +88,51 @@ return (clojure.core.instance_QMARK_.apply(null,[clojure.lang.ISeq,x_1]))})))}).
//======
//(def map? (fn map? [x] (instance? clojure.lang.IPersistentMap x)))
//---
-(function __clojure_core_fn_91(){
-return (clojure.JS.def(clojure.core,"map_QMARK_",(function __clojure_core_fn_91_map_QMARK_93(x_1){
+(function __clojure_core_fn_630(){
+return (clojure.JS.def(clojure.core,"map_QMARK_",(function __clojure_core_fn_630_map_QMARK_632(x_1){
var map_QMARK__0=arguments.callee;
return (clojure.core.instance_QMARK_.apply(null,[clojure.lang.IPersistentMap,x_1]))})))}).apply(null,[]);
//======
//(def vector? (fn vector? [x] (instance? clojure.lang.IPersistentVector x)))
//---
-(function __clojure_core_fn_96(){
-return (clojure.JS.def(clojure.core,"vector_QMARK_",(function __clojure_core_fn_96_vector_QMARK_98(x_1){
+(function __clojure_core_fn_635(){
+return (clojure.JS.def(clojure.core,"vector_QMARK_",(function __clojure_core_fn_635_vector_QMARK_637(x_1){
var vector_QMARK__0=arguments.callee;
return (clojure.core.instance_QMARK_.apply(null,[clojure.lang.IPersistentVector,x_1]))})))}).apply(null,[]);
//======
//(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_core_fn_101(){
-return (clojure.JS.def(clojure.core,"sigs",(function __clojure_core_fn_101_sigs_103(fdecl_1){
-var fdecl_3,ret_2;
+(function __clojure_core_fn_640(){
+return (clojure.JS.def(clojure.core,"sigs",(function __clojure_core_fn_640_sigs_642(fdecl_1){
+var ret_2,fdecl_3;
return (((clojure.core.seq_QMARK_.apply(null,[clojure.core.first.apply(null,[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,_rtn=[clojure.core.conj.apply(null,[ret_2,clojure.core.first.apply(null,[clojure.core.first.apply(null,[fdecl_3])])]),clojure.core.rest.apply(null,[fdecl_3])],ret_2=_rtn[0],fdecl_3=_rtn[1])):(clojure.core.seq.apply(null,[ret_2])))}while(_cnt);return _rtn;})())):(clojure.core.list.apply(null,[clojure.core.first.apply(null,[fdecl_1])]))))})))}).apply(null,[]);
// Skipping: (def assoc (fn assoc ([map key val] (. clojure.lang.RT (assoc map key val))) ([map key val & kvs] (let [ret (assoc map key val)] (if kvs (recur ret (first kvs) (second kvs) (rrest kvs)) ret)))))
//======
-//(def meta (fn meta [x] (if (instance? clojure.lang.IObj x) (. x (meta)))))
+//(def meta (fn meta [x] (if (instance? clojure.lang.IMeta x) (. x (meta)))))
//---
-(function __clojure_core_fn_112(){
-return (clojure.JS.def(clojure.core,"meta",(function __clojure_core_fn_112_meta_114(x_1){
+(function __clojure_core_fn_651(){
+return (clojure.JS.def(clojure.core,"meta",(function __clojure_core_fn_651_meta_653(x_1){
var meta_0=arguments.callee;
-return (((clojure.core.instance_QMARK_.apply(null,[clojure.lang.IObj,x_1]))?((x_1).meta()):(null)))})))}).apply(null,[]);
+return (((clojure.core.instance_QMARK_.apply(null,[clojure.lang.IMeta,x_1]))?((x_1).meta()):(null)))})))}).apply(null,[]);
//======
//(def with-meta (fn with-meta [x m] (. x (withMeta m))))
//---
-(function __clojure_core_fn_117(){
-return (clojure.JS.def(clojure.core,"with_meta",(function __clojure_core_fn_117_with_meta_119(x_1,m_2){
+(function __clojure_core_fn_656(){
+return (clojure.JS.def(clojure.core,"with_meta",(function __clojure_core_fn_656_with_meta_658(x_1,m_2){
var with_meta_0=arguments.callee;
return ((x_1).withMeta(m_2))})))}).apply(null,[]);
//======
//(def last (fn last [s] (if (rest s) (recur (rest s)) (first s))))
//---
-(function __clojure_core_fn_122(){
-return (clojure.JS.def(clojure.core,"last",(function __clojure_core_fn_122_last_124(s_1){
+(function __clojure_core_fn_661(){
+return (clojure.JS.def(clojure.core,"last",(function __clojure_core_fn_661_last_663(s_1){
var _cnt,_rtn,last_0=arguments.callee;
do{_cnt=0;_rtn=((clojure.core.rest.apply(null,[s_1]))?((_cnt=1,_rtn=[clojure.core.rest.apply(null,[s_1])],s_1=_rtn[0])):(clojure.core.first.apply(null,[s_1])))
}while(_cnt);return _rtn;})))}).apply(null,[]);
@@ -134,8 +140,8 @@ do{_cnt=0;_rtn=((clojure.core.rest.apply(null,[s_1]))?((_cnt=1,_rtn=[clojure.cor
//======
//(def butlast (fn butlast [s] (loop [ret [] s s] (if (rest s) (recur (conj ret (first s)) (rest s)) (seq ret)))))
//---
-(function __clojure_core_fn_127(){
-return (clojure.JS.def(clojure.core,"butlast",(function __clojure_core_fn_127_butlast_129(s_1){
+(function __clojure_core_fn_666(){
+return (clojure.JS.def(clojure.core,"butlast",(function __clojure_core_fn_666_butlast_668(s_1){
var ret_2,s_3,butlast_0=arguments.callee;
return (((function __loop(){var _rtn,_cnt;(ret_2=clojure.lang.PersistentVector.EMPTY),
(s_3=s_1);do{_cnt=0;
@@ -146,16 +152,16 @@ _rtn=((clojure.core.rest.apply(null,[s_3]))?((_cnt=1,_rtn=[clojure.core.conj.app
//======
//(defn cast "Throws a ClassCastException if x is not a c, else returns x." [c x] (. c (cast x)))
//---
-(function __clojure_core_fn_140(){
-return (clojure.JS.def(clojure.core,"cast",(function __clojure_core_fn_140_cast_142(c_1,x_2){
+(function __clojure_core_fn_679(){
+return (clojure.JS.def(clojure.core,"cast",(function __clojure_core_fn_679_cast_681(c_1,x_2){
return ((c_1).cast(x_2))})))}).apply(null,[]);
// Skipping: (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)))
//======
//(defn vector "Creates a new vector containing the args." ([] []) ([& args] (. clojure.lang.LazilyPersistentVector (create args))))
//---
-(function __clojure_core_fn_152(){
-return (clojure.JS.def(clojure.core,"vector",clojure.JS.variadic(0,(function __clojure_core_fn_152_vector_154(){switch(arguments.length){
+(function __clojure_core_fn_691(){
+return (clojure.JS.def(clojure.core,"vector",clojure.JS.variadic(0,(function __clojure_core_fn_691_vector_693(){switch(arguments.length){
case 0:return (clojure.lang.PersistentVector.EMPTY)}
var args_1=clojure.JS.rest_args(this,arguments,0);
return (clojure.lang.LazilyPersistentVector.create(args_1))}))))}).apply(null,[]);
@@ -163,16 +169,16 @@ return (clojure.lang.LazilyPersistentVector.create(args_1))}))))}).apply(null,[]
//======
//(defn vec "Creates a new vector containing the contents of coll." ([coll] (. clojure.lang.LazilyPersistentVector (createOwning (to-array coll)))))
//---
-(function __clojure_core_fn_159(){
-return (clojure.JS.def(clojure.core,"vec",(function __clojure_core_fn_159_vec_161(coll_1){
+(function __clojure_core_fn_698(){
+return (clojure.JS.def(clojure.core,"vec",(function __clojure_core_fn_698_vec_700(coll_1){
return (clojure.lang.LazilyPersistentVector.createOwning(clojure.core.to_array.apply(null,[coll_1])))})))}).apply(null,[]);
// Skipping: (defn hash-map "keyval => key val\n Returns a new hash map with supplied mappings." ([] {}) ([& keyvals] (. clojure.lang.PersistentHashMap (create keyvals))))
//======
//(defn hash-set "Returns a new hash set with supplied keys." ([] #{}) ([& keys] (. clojure.lang.PersistentHashSet (create keys))))
//---
-(function __clojure_core_fn_172(){
-return (clojure.JS.def(clojure.core,"hash_set",clojure.JS.variadic(0,(function __clojure_core_fn_172_hash_set_174(){switch(arguments.length){
+(function __clojure_core_fn_711(){
+return (clojure.JS.def(clojure.core,"hash_set",clojure.JS.variadic(0,(function __clojure_core_fn_711_hash_set_713(){switch(arguments.length){
case 0:return (clojure.lang.PersistentHashSet.EMPTY)}
var keys_1=clojure.JS.rest_args(this,arguments,0);
return (clojure.lang.PersistentHashSet.create(keys_1))}))))}).apply(null,[]);
@@ -180,24 +186,24 @@ return (clojure.lang.PersistentHashSet.create(keys_1))}))))}).apply(null,[]);
//======
//(defn sorted-map "keyval => key val\n Returns a new sorted map with supplied mappings." ([& keyvals] (. clojure.lang.PersistentTreeMap (create keyvals))))
//---
-(function __clojure_core_fn_179(){
-return (clojure.JS.def(clojure.core,"sorted_map",clojure.JS.variadic(0,(function __clojure_core_fn_179_sorted_map_181(){
+(function __clojure_core_fn_718(){
+return (clojure.JS.def(clojure.core,"sorted_map",clojure.JS.variadic(0,(function __clojure_core_fn_718_sorted_map_720(){
var keyvals_1=clojure.JS.rest_args(this,arguments,0);
return (clojure.lang.PersistentTreeMap.create(keyvals_1))}))))}).apply(null,[]);
//======
//(defn sorted-set "Returns a new sorted set with supplied keys." ([& keys] (. clojure.lang.PersistentTreeSet (create keys))))
//---
-(function __clojure_core_fn_185(){
-return (clojure.JS.def(clojure.core,"sorted_set",clojure.JS.variadic(0,(function __clojure_core_fn_185_sorted_set_187(){
+(function __clojure_core_fn_724(){
+return (clojure.JS.def(clojure.core,"sorted_set",clojure.JS.variadic(0,(function __clojure_core_fn_724_sorted_set_726(){
var keys_1=clojure.JS.rest_args(this,arguments,0);
return (clojure.lang.PersistentTreeSet.create(keys_1))}))))}).apply(null,[]);
//======
//(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_core_fn_191(){
-return (clojure.JS.def(clojure.core,"sorted_map_by",clojure.JS.variadic(1,(function __clojure_core_fn_191_sorted_map_by_193(comparator_1){
+(function __clojure_core_fn_730(){
+return (clojure.JS.def(clojure.core,"sorted_map_by",clojure.JS.variadic(1,(function __clojure_core_fn_730_sorted_map_by_732(comparator_1){
var keyvals_2=clojure.JS.rest_args(this,arguments,1);
return (clojure.lang.PersistentTreeMap.create(comparator_1,keyvals_2))}))))}).apply(null,[]);
// Skipping: (def defmacro (fn [name & args] (list (quote do) (cons (quote clojure.core/defn) (cons name args)) (list (quote .) (list (quote var) name) (quote (setMacro))))))
@@ -208,40 +214,40 @@ return (clojure.lang.PersistentTreeMap.create(comparator_1,keyvals_2))}))))}).ap
//======
//(defn nil? "Returns true if x is nil, false otherwise." {:tag Boolean} [x] (identical? x nil))
//---
-(function __clojure_core_fn_224(){
-return (clojure.JS.def(clojure.core,"nil_QMARK_",(function __clojure_core_fn_224_nil_QMARK_226(x_1){
+(function __clojure_core_fn_763(){
+return (clojure.JS.def(clojure.core,"nil_QMARK_",(function __clojure_core_fn_763_nil_QMARK_765(x_1){
return (clojure.core.identical_QMARK_.apply(null,[x_1,null]))})))}).apply(null,[]);
//======
//(defn false? "Returns true if x is the value false, false otherwise." {:tag Boolean} [x] (identical? x false))
//---
-(function __clojure_core_fn_230(){
-return (clojure.JS.def(clojure.core,"false_QMARK_",(function __clojure_core_fn_230_false_QMARK_232(x_1){
+(function __clojure_core_fn_769(){
+return (clojure.JS.def(clojure.core,"false_QMARK_",(function __clojure_core_fn_769_false_QMARK_771(x_1){
return (clojure.core.identical_QMARK_.apply(null,[x_1,false]))})))}).apply(null,[]);
//======
//(defn true? "Returns true if x is the value true, false otherwise." {:tag Boolean} [x] (identical? x true))
//---
-(function __clojure_core_fn_236(){
-return (clojure.JS.def(clojure.core,"true_QMARK_",(function __clojure_core_fn_236_true_QMARK_238(x_1){
+(function __clojure_core_fn_775(){
+return (clojure.JS.def(clojure.core,"true_QMARK_",(function __clojure_core_fn_775_true_QMARK_777(x_1){
return (clojure.core.identical_QMARK_.apply(null,[x_1,true]))})))}).apply(null,[]);
//======
//(defn not "Returns true if x is logical false, false otherwise." {:tag Boolean} [x] (if x false true))
//---
-(function __clojure_core_fn_242(){
-return (clojure.JS.def(clojure.core,"not",(function __clojure_core_fn_242_not_244(x_1){
+(function __clojure_core_fn_781(){
+return (clojure.JS.def(clojure.core,"not",(function __clojure_core_fn_781_not_783(x_1){
return (((x_1)?(false):(true)))})))}).apply(null,[]);
//======
//(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] ((fn [sb more] (if more (recur (. sb (append (str (first more)))) (rest more)) (str sb))) (clojure.lang.RT/makeStringBuilder (str x)) ys)))
//---
-(function __clojure_core_fn_248(){
-return (clojure.JS.def(clojure.core,"str",clojure.JS.variadic(1,(function __clojure_core_fn_248_str_250(x_1){switch(arguments.length){
-case 1:return (((clojure.core.nil_QMARK_.apply(null,[x_1]))?(""):((x_1).toString())))
-case 0:return ("")}
+(function __clojure_core_fn_787(){
+return (clojure.JS.def(clojure.core,"str",clojure.JS.variadic(1,(function __clojure_core_fn_787_str_789(x_1){switch(arguments.length){
+case 0:return ("")
+case 1:return (((clojure.core.nil_QMARK_.apply(null,[x_1]))?(""):((x_1).toString())))}
var ys_2=clojure.JS.rest_args(this,arguments,1);
-return ((function __clojure_core_fn_248_str_250_fn_254(sb_1,more_2){
+return ((function __clojure_core_fn_787_str_789_fn_793(sb_1,more_2){
var _cnt,_rtn;
do{_cnt=0;_rtn=((more_2)?((_cnt=1,_rtn=[(sb_1).append(clojure.core.str.apply(null,[clojure.core.first.apply(null,[more_2])])),clojure.core.rest.apply(null,[more_2])],sb_1=_rtn[0],more_2=_rtn[1])):(clojure.core.str.apply(null,[sb_1])))
}while(_cnt);return _rtn;}).apply(null,[clojure.lang.RT.makeStringBuilder(clojure.core.str.apply(null,[x_1])),ys_2]))}))))}).apply(null,[]);
@@ -249,100 +255,101 @@ do{_cnt=0;_rtn=((more_2)?((_cnt=1,_rtn=[(sb_1).append(clojure.core.str.apply(nul
//======
//(defn symbol? "Return true if x is a Symbol" [x] (instance? clojure.lang.Symbol x))
//---
-(function __clojure_core_fn_259(){
-return (clojure.JS.def(clojure.core,"symbol_QMARK_",(function __clojure_core_fn_259_symbol_QMARK_261(x_1){
+(function __clojure_core_fn_798(){
+return (clojure.JS.def(clojure.core,"symbol_QMARK_",(function __clojure_core_fn_798_symbol_QMARK_800(x_1){
return (clojure.core.instance_QMARK_.apply(null,[clojure.lang.Symbol,x_1]))})))}).apply(null,[]);
//======
//(defn keyword? "Return true if x is a Keyword" [x] (instance? clojure.lang.Keyword x))
//---
-(function __clojure_core_fn_265(){
-return (clojure.JS.def(clojure.core,"keyword_QMARK_",(function __clojure_core_fn_265_keyword_QMARK_267(x_1){
+(function __clojure_core_fn_804(){
+return (clojure.JS.def(clojure.core,"keyword_QMARK_",(function __clojure_core_fn_804_keyword_QMARK_806(x_1){
return (clojure.core.instance_QMARK_.apply(null,[clojure.lang.Keyword,x_1]))})))}).apply(null,[]);
// Skipping: (defn symbol "Returns a Symbol with the given namespace and name." ([name] (if (symbol? name) name (. clojure.lang.Symbol (intern name)))) ([ns name] (. clojure.lang.Symbol (intern ns name))))
// Skipping: (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] (if (keyword? name) name (. clojure.lang.Keyword (intern nil name)))) ([ns name] (. clojure.lang.Keyword (intern ns name))))
//======
-//(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))))))))
+//(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_core_fn_285(){
-return (clojure.JS.def(clojure.core,"gensym",(function __clojure_core_fn_285_gensym_287(prefix_string_1){switch(arguments.length){
+(function __clojure_core_fn_824(){
+return (clojure.JS.def(clojure.core,"gensym",(function __clojure_core_fn_824_gensym_826(prefix_string_1){switch(arguments.length){
case 0:return (clojure.core.gensym.apply(null,["G__"]))}
return (clojure.lang.Symbol.intern(clojure.core.str.apply(null,[prefix_string_1,clojure.core.str.apply(null,[clojure.lang.RT.nextID()])])))})))}).apply(null,[]);
-// Skipping: (defmacro cond "Takes a set of test/expr pairs. It evaluates each test one at a\n time. If a test returns logical true, cond evaluates and returns\n the value of the corresponding expr and doesn't evaluate any of the\n other tests or exprs. (cond) returns nil." [& clauses] (when clauses (list (quote if) (first clauses) (second clauses) (cons (quote clojure.core/cond) (rest (rest clauses))))))
+// Skipping: (defmacro cond "Takes a set of test/expr pairs. It evaluates each test one at a\n time. If a test returns logical true, cond evaluates and returns\n the value of the corresponding expr and doesn't evaluate any of the\n other tests or exprs. (cond) returns nil." [& clauses] (when clauses (list (quote if) (first clauses) (if (rest clauses) (second clauses) (throw (IllegalArgumentException. "cond requires an even number of forms"))) (cons (quote clojure.core/cond) (rest (rest clauses))))))
//======
//(defn spread {:private true} [arglist] (cond (nil? arglist) nil (nil? (rest arglist)) (seq (first arglist)) :else (cons (first arglist) (spread (rest arglist)))))
//---
-(function __clojure_core_fn_301(){
-return (clojure.JS.def(clojure.core,"spread",(function __clojure_core_fn_301_spread_303(arglist_1){
+(function __clojure_core_fn_840(){
+return (clojure.JS.def(clojure.core,"spread",(function __clojure_core_fn_840_spread_842(arglist_1){
return (((clojure.core.nil_QMARK_.apply(null,[arglist_1]))?(null):(((clojure.core.nil_QMARK_.apply(null,[clojure.core.rest.apply(null,[arglist_1])]))?(clojure.core.seq.apply(null,[clojure.core.first.apply(null,[arglist_1])])):(((clojure.core.keyword("","else"))?(clojure.core.cons.apply(null,[clojure.core.first.apply(null,[arglist_1]),clojure.core.spread.apply(null,[clojure.core.rest.apply(null,[arglist_1])])])):(null)))))))})))}).apply(null,[]);
// Skipping: (defn apply "Applies fn f to the argument list formed by prepending args to argseq." {:arglists (quote ([f args* argseq]))} [f & args] (. f (applyTo (spread args))))
//======
//(defn list* "Creates a new list containing the item prepended to more." [item & more] (spread (cons item more)))
//---
-(function __clojure_core_fn_313(){
-return (clojure.JS.def(clojure.core,"list_STAR_",clojure.JS.variadic(1,(function __clojure_core_fn_313_list_STAR_315(item_1){
+(function __clojure_core_fn_852(){
+return (clojure.JS.def(clojure.core,"list_STAR_",clojure.JS.variadic(1,(function __clojure_core_fn_852_list_STAR_854(item_1){
var more_2=clojure.JS.rest_args(this,arguments,1);
return (clojure.core.spread.apply(null,[clojure.core.cons.apply(null,[item_1,more_2])]))}))))}).apply(null,[]);
-// Skipping: (defmacro delay "Takes a body of expressions and yields a Delay object than will\n invoke the body only the first time it is forced (with force), and\n will cache the result and return it on all subsequent force calls" [& body] (list (quote new) (quote clojure.lang.Delay) (list* (quote clojure.core/fn) [] body)))
+// Skipping: (defmacro delay "Takes a body of expressions and yields a Delay object that will\n invoke the body only the first time it is forced (with force), and\n will cache the result and return it on all subsequent force calls" [& body] (list (quote new) (quote clojure.lang.Delay) (list* (quote clojure.core/fn) [] body)))