Cannot access variables without namespace in ClojureScript repl.

355 views
Skip to first unread message

Takahiro Hozumi

unread,
Jan 15, 2012, 6:57:20 AM1/15/12
to Clojure
Hi,
In my browser repl, which follows the ClojureScript wiki[1], I must
specify variables with namespace even if `in-ns` is used, but I
noticed that I don't have to do in the repl of ClojureScript One[2].

Am I the only one who cannot access variables without namespace?
What makes the diffirence?

log:
ClojureScript:cljs.user> (in-ns 'myns)

ClojureScript:myns> myns/mydiv ;;with a namespace
#<[object HTMLDivElement]>

ClojureScript:myns> mydiv ;;without a namespace
"Error evaluating:" mydiv :as ".mydiv;\n"
#<SyntaxError: Unexpected token .>
SyntaxError: Unexpected token .
at http://localhost:8080/cljs/clojure/browser/repl.js:21:158

[1] https://github.com/clojure/clojurescript/wiki/Emacs-%26-inferior-lisp-mode
[2] https://github.com/brentonashworth/one/wiki/Development

Thanks.

Brenton

unread,
Jan 15, 2012, 9:32:02 AM1/15/12
to Clojure
I think the problem here is with the ClojureScript REPL and single-
segment namespaces.

We found a couple of problems with the ClojureScript REPL while
working on One and will address them soon. If you confirm that this is
the problem, please let us know. Also, feel free to add an issue to
JIRA with the steps to reproduce.

Thanks,
Brenton

On Jan 15, 6:57 am, Takahiro Hozumi <fat...@googlemail.com> wrote:
> Hi,
> In my browser repl, which follows the ClojureScript wiki[1], I must
> specify variables with namespace even if `in-ns` is used, but I
> noticed that I don't have to do in the repl of ClojureScript One[2].
>
> Am I the only one who cannot access variables without namespace?
> What makes the diffirence?
>
> log:
> ClojureScript:cljs.user> (in-ns 'myns)
>
> ClojureScript:myns> myns/mydiv     ;;with a namespace
> #<[object HTMLDivElement]>
>
> ClojureScript:myns> mydiv             ;;without a namespace
> "Error evaluating:" mydiv :as ".mydiv;\n"
> #<SyntaxError: Unexpected token .>
> SyntaxError: Unexpected token .
>     athttp://localhost:8080/cljs/clojure/browser/repl.js:21:158
>
> [1]https://github.com/clojure/clojurescript/wiki/Emacs-%26-inferior-lisp...
> [2]https://github.com/brentonashworth/one/wiki/Development
>
> Thanks.

Takahiro

unread,
Jan 15, 2012, 10:21:42 AM1/15/12
to clo...@googlegroups.com
Hi Brenton,
Unfortunately two segment namespaces also causes the same problem.
However, I've found that this problem can be avoided by using `ns`
instead of `in-ns`.

Thanks!

2012/1/15 Brenton <bash...@gmail.com>:

> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clo...@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+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

Krukow

unread,
Feb 16, 2012, 7:28:33 AM2/16/12
to Clojure
On Jan 15, 3:32 pm, Brenton <bashw...@gmail.com> wrote:
> We found a couple of problems with theClojureScriptREPL while
> working onOneand will address them soon. If you confirm that this is
> the problem, please let us know. Also, feel free to add an issue to
> JIRA with the steps to reproduce.
[snip]

I'm experiencing the same problem.

I've created an issue on github.

https://github.com/brentonashworth/one/issues/116

I don't understand this well enough to see if it is a ClojureScript
issue or 'one' issue.

- Karl
Reply all
Reply to author
Forward
0 new messages