diff options
author | Chouser <chouser@n01se.net> | 2008-10-16 03:28:58 +0000 |
---|---|---|
committer | Chouser <chouser@n01se.net> | 2008-10-16 03:28:58 +0000 |
commit | 7194e3d2c4d031339bd12bf1963384c41a25d21d (patch) | |
tree | fdccf568a833eb0fe127859eedba7b4de54c0254 /clojurescript/clj.js | |
parent | ba31da0866de0a825ac2a7d7ddeec7b145ddfd63 (diff) |
ClojureScript: simple browser-based repl now functional.
Diffstat (limited to 'clojurescript/clj.js')
-rw-r--r-- | clojurescript/clj.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clojurescript/clj.js b/clojurescript/clj.js index b5c1a84e..79f3721e 100644 --- a/clojurescript/clj.js +++ b/clojurescript/clj.js @@ -644,6 +644,11 @@ clojure.JS.defclass( clojure.lang, "Var", { this.push( val ); }, hasRoot: function() { return this.stack.length > 0; }, + toString: function() { + if( this.ns !== null ) + return "#=(var " + this.ns.name + "/" + this.name + ")"; + return "#<Var: " + (this.name !== null ? this.name : "--unnamed--") + ">"; + }, hashCode: function() { return clojure.lang.Util.hash( this.ns + "/" + this.name ); } @@ -1926,6 +1931,8 @@ clojure.lang.Namespace.prototype.hashCode = function() { return clojure.hash( this.name ); }; +clojure.in_ns("'user"); + (function() { var buf = []; function write(s) { |