Re: Bizarre ClojureScript issue

2011-07-28 Thread Anthony Grimes
Absolutely. -- 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

Bizarre ClojureScript issue

2011-07-27 Thread Anthony Grimes
Sorry for the terrible subject line. I couldn't think of an easy way to describe the problem in a single line. (def net (node/require net)) (defn portal [port host] (.createConnection net port host)) (defn -main [ args] ; Note that only one of these -main functions is in the file at any

Re: Bizarre ClojureScript issue

2011-07-27 Thread Anthony Grimes
It's odd that it works fine in the first one but no the second. You'd think with that post button being so small that it'd be difficult to... yeah. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: Bizarre ClojureScript issue

2011-07-27 Thread Kevin Downey
are you sure you don't have an extra space in there? (. createConnection net …) vs. (.createConnection net …) On Wed, Jul 27, 2011 at 5:38 PM, Anthony Grimes disciplera...@gmail.com wrote: Sorry for the terrible subject line. I couldn't think of an easy way to describe the problem in a single

Re: Bizarre ClojureScript issue

2011-07-27 Thread Anthony Grimes
Yep, just double checked. No extra spaces. -- 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

Re: Bizarre ClojureScript issue

2011-07-27 Thread Kevin Downey
have you looked at the generated javascript? On Wed, Jul 27, 2011 at 5:44 PM, Anthony Grimes disciplera...@gmail.com wrote: Yep, just double checked. No extra spaces. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send

Re: Bizarre ClojureScript issue

2011-07-27 Thread Anthony Grimes
Yeah. To the extent that I can read Javascript, the calls look exactly the same and it looks fine. -- 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

Re: Bizarre ClojureScript issue

2011-07-27 Thread Ken Wesson
On Wed, Jul 27, 2011 at 8:38 PM, Anthony Grimes disciplera...@gmail.com wrote: Sorry for the terrible subject line. I couldn't think of an easy way to describe the problem in a single line. (def net (node/require net)) (defn portal   [port host] (.createConnection net port host)) (defn -main

Re: Bizarre ClojureScript issue

2011-07-27 Thread Anthony Grimes
That's actually what I thought at first, but the node example that ships with ClojureScript actually does the same thing (uses a node function outside of -main and then calls that function from -main) I did and it works fine. Here is the generated JavaScript for the failing -main and such:

Re: Bizarre ClojureScript issue

2011-07-27 Thread Ken Wesson
On Wed, Jul 27, 2011 at 9:05 PM, Anthony Grimes disciplera...@gmail.com wrote: That's actually what I thought at first, but the node example that ships with ClojureScript actually does the same thing (uses a node function outside of -main and then calls that function from -main) I did and it

Re: Bizarre ClojureScript issue

2011-07-27 Thread Anthony Grimes
The first argument to Javascript's 'call' is a 'this' argument. All generated functions are called like this. -- 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

Re: Bizarre ClojureScript issue

2011-07-27 Thread Ken Wesson
On Wed, Jul 27, 2011 at 9:21 PM, Anthony Grimes disciplera...@gmail.com wrote: The first argument to Javascript's 'call' is a 'this' argument. All generated functions are called like this. If portal.core.net is an instance rather than a class variable then a null this would explain it not

Re: Bizarre ClojureScript issue

2011-07-27 Thread Anthony Grimes
It looks like main is called the same way. Like I said, my example is not much different than the one that comes with cljs. (ns nodels (:require [cljs.nodejs :as nodejs])) (def fs (nodejs/require fs)) (def path (nodejs/require path)) (defn file-seq [dir] (tree-seq (fn [f] (.isDirectory

Re: Bizarre ClojureScript issue

2011-07-27 Thread Ken Wesson
On Wed, Jul 27, 2011 at 9:30 PM, Anthony Grimes disciplera...@gmail.com wrote: It looks like main is called the same way. Like I said, my example is not much different than the one that comes with cljs. (ns nodels   (:require [cljs.nodejs :as nodejs])) (def fs (nodejs/require fs)) (def path

Re: Bizarre ClojureScript issue

2011-07-27 Thread Asim Jalis
Is it possible that the new function called portal is overwriting the namespace called portal? Could you try renaming the function called portal to something else? Like portal2? On Wed, Jul 27, 2011 at 6:05 PM, Anthony Grimes disciplera...@gmail.com wrote: That's actually what I thought at

Re: Bizarre ClojureScript issue

2011-07-27 Thread Anthony Grimes
Hah! That was it! You, sir, are one clever fellow. Thank you very much. -- 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

Re: Bizarre ClojureScript issue

2011-07-27 Thread Ken Wesson
On Wed, Jul 27, 2011 at 9:48 PM, Anthony Grimes disciplera...@gmail.com wrote: Hah! That was it! You, sir, are one clever fellow. Thank you very much. Damn. I didn't think of that. In normal Clojure, defn'ing x.y/x doesn't clobber the Java package named x with a function named x. But it looks