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 em

Re: Bizarre ClojureScript issue

2011-07-28 Thread Rich Hickey
Could you please file a bug report with both your example, the JS code and the explanation? Thanks, Rich On Jul 27, 2011, at 9:48 PM, Anthony Grimes wrote: Hah! That was it! You, sir, are one clever fellow. Thank you very much. -- You received this message because you are subscribed to t

Re: Bizarre ClojureScript issue

2011-07-27 Thread Ken Wesson
On Wed, Jul 27, 2011 at 9:48 PM, Anthony Grimes 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 like in JS packages and f

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 wi

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 wrote: > That's actually what I thought at first, but the node example

Re: Bizarre ClojureScript issue

2011-07-27 Thread Anthony Grimes
Right, I have an ns form. I just didn't post it. (ns portal.core (:require [cljs.nodejs :as node] [clojure.string :as string] [goog.date.DateTime :as time])) This is all part of a bigger application. I just pulled stuff out to make a minimal example (that does fail, by

Re: Bizarre ClojureScript issue

2011-07-27 Thread Ken Wesson
On Wed, Jul 27, 2011 at 9:30 PM, Anthony Grimes 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 (nodejs/requir

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] (.isDirect

Re: Bizarre ClojureScript issue

2011-07-27 Thread Ken Wesson
On Wed, Jul 27, 2011 at 9:21 PM, Anthony Grimes 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 resolving. Is "_main" cal

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 membe

Re: Bizarre ClojureScript issue

2011-07-27 Thread Ken Wesson
On Wed, Jul 27, 2011 at 9:05 PM, Anthony Grimes 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 works > fine. > Here is

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: por

Re: Bizarre ClojureScript issue

2011-07-27 Thread Ken Wesson
On Wed, Jul 27, 2011 at 8:38 PM, Anthony Grimes 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 [& args] ; Note

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 mod

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 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 email to clojure@goo

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 unsub

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 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/

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 clojure@google