Hey all,

This is probably a silly question. But I'ms still struggling with some basic
things in ClojureScript. I'm trying to run ./script/repljs to evaluate some
basic Clojurescript code. But evaluation keeps on breaking. So I tried a
clean clojurescript install with the "Hello" example they give in the
QuickStart guide. In the repljs, a lot of calls fail, first among them a
call to (ns ..).

$ git clone git://github.com/clojure/clojurescript.git
$ cd clojurescript
$ script/bootstrap
$ ./script/repljs

#'user/jse
"Type: " :cljs/quit " to quit"
*ClojureScript:cljs.user> (ns hello)*
"Error evaluating:" (cljs.core.prn (ns hello)) :as
"cljs.core.prn.call(null,goog.provide('hello');\ngoog.require('cljs.core');\n);\n"
sun.org.mozilla.javascript.internal.EvaluatorException: missing ) after
argument list
        at
sun.org.mozilla.javascript.internal.DefaultErrorReporter.runtimeError(DefaultErrorReporter.java:84)
        at
sun.org.mozilla.javascript.internal.DefaultErrorReporter.error(DefaultErrorReporter.java:71)


And any subsequent call after that fails…

*ClojureScript:hello> (defn thing[v] (str "Hello " v)) *
"Error evaluating:" (cljs.core.prn (defn thing [v] (str "Hello " v))) :as
"cljs.core.prn.call(null,hello.thing = (function thing(v){\nreturn
cljs.core.str.call(null,\"Hello \",v);\n}));\n"
sun.org.mozilla.javascript.internal.EcmaError: ReferenceError: "hello" is
not defined.
        at
sun.org.mozilla.javascript.internal.ScriptRuntime.constructError(ScriptRuntime.java:3224)
        at
sun.org.mozilla.javascript.internal.ScriptRuntime.constructError(ScriptRuntime.java:3214)

However if I just try defining that function before hand, it works cleanly.
I'm wondering why the trouble with working in other namespaces in repljs?
I eventually want to do testing with Google Closure's testing lib
*
*
*(ns bkeeping*
*  (:require [goog.testing.junit :as gtest]))*
*  *
*(gtest/assertEquals "A message" "1" "2")*


But still other calls fail as well. I'm trying to require the goog.testing
library. But even something like this fails...

webkell@ubuntu:~/temp/clojurescript$ ./script/repljs
#'user/jse
"Type: " :cljs/quit " to quit"
*ClojureScript:cljs.user> (require 'goog.testing.junit)*
WARNING: Use of undeclared Var cljs.user/require at line 1
"Error evaluating:" (cljs.core.prn (require (quote goog.testing.junit))) :as
"cljs.core.prn.call(null,cljs.user.require.call(null,\"
'goog.testing.junit\"));\n"
sun.org.mozilla.javascript.internal.EcmaError: TypeError: Cannot call method
"call" of undefined
        at
sun.org.mozilla.javascript.internal.ScriptRuntime.constructError(ScriptRuntime.java:3224)
        at
sun.org.mozilla.javascript.internal.ScriptRuntime.constructError(ScriptRuntime.java:3214)


I obviously don't want to recompile my cljs code after each edit.
development would just get cumbersome. I'm wondering what I'm missing.


Thanks
Tim

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to