Re: CLJS Function clobbering js function of same name

2014-08-04 Thread Herwig Hochleitner
2014-08-04 22:28 GMT+02:00 David Nolen : > I meant would not > > > On Mon, Aug 4, 2014 at 4:28 PM, David Nolen > wrote: > >> I would rely on the behavior in the REPL to check this - the REPL >> compilation environment is likely different. >> > Yes, I noticed that ./script/repl has different behav

Re: CLJS Function clobbering js function of same name

2014-08-04 Thread Luc Prefontaine
That's what I inferred but it has nothing to do with my astonishing ESP capabilities, currently drinking an excellent beer in Rabat :) Cheers, Luc P > I meant would not > > > On Mon, Aug 4, 2014 at 4:28 PM, David Nolen wrote: > > > I would rely on the behavior in the REPL to check this - t

Re: CLJS Function clobbering js function of same name

2014-08-04 Thread David Nolen
I meant would not On Mon, Aug 4, 2014 at 4:28 PM, David Nolen wrote: > I would rely on the behavior in the REPL to check this - the REPL > compilation environment is likely different. > > > On Mon, Aug 4, 2014 at 3:59 PM, Sam Ritchie wrote: > >> Hey Herwig, >> >> I'm currently on [org.clojure/

Re: CLJS Function clobbering js function of same name

2014-08-04 Thread David Nolen
I would rely on the behavior in the REPL to check this - the REPL compilation environment is likely different. On Mon, Aug 4, 2014 at 3:59 PM, Sam Ritchie wrote: > Hey Herwig, > > I'm currently on [org.clojure/clojurescript "0.0-2261"], and I'm seeing no > munging: > > paddleguru.api.register.v

Re: CLJS Function clobbering js function of same name

2014-08-04 Thread Sam Ritchie
Hey Herwig, I'm currently on [org.clojure/clojurescript "0.0-2261"], and I'm seeing no munging: paddleguru.api.register.validation> (defn console []) # nil paddleguru.api.register.validation> (defn console [s] (.log js/console s)) # nil paddleguru.api.register.validation> (console "HI!") "Erro

Re: CLJS Function clobbering js function of same name

2014-08-04 Thread Herwig Hochleitner
Thomas, in my test, (defn console []) is munged aswell, so I'm guessing that Sam is using a version from before https://github.com/clojure/clojurescript/commit/f371c04d95a00cdda79c63f89f35088d62de8e73 Sam, is that correct? The observation that eval should be in js-globals is irrelevant, because as

Re: CLJS Function clobbering js function of same name

2014-08-04 Thread Thomas Heller
https://gist.github.com/thheller/4731f682665d38b1053c On Monday, August 4, 2014 3:34:33 PM UTC+2, Nicola Mometto wrote: > > > Try with (fn document [] js/document) > > Thomas Heller writes: > > > I was not able to reproduce Sam's initial problem. > > > > "eval" as I said does not appear in the

Re: CLJS Function clobbering js function of same name

2014-08-04 Thread Herwig Hochleitner
2014-08-04 16:27 GMT+02:00 David Nolen : > > We don't gensym let bindings - the shadowing logic was added to create > stable names. In fact, we do within statement contexts. I wrote that as a fix for the case (do (let [x 1] (fn [] x)) (let [x 2] (comment clobbered x in fn))) (as well as topl

Re: CLJS Function clobbering js function of same name

2014-08-04 Thread David Nolen
On Mon, Aug 4, 2014 at 9:11 AM, Herwig Hochleitner wrote: > I dug a bit deeper to see where :js-globals came from and found the old > ticket for this exact issue: http://dev.clojure.org/jira/browse/CLJS-680 > I propose that we remove it, because it's unnessecary when we gensym fn > names the same

Re: CLJS Function clobbering js function of same name

2014-08-04 Thread Nicola Mometto
Try with (fn document [] js/document) Thomas Heller writes: > I was not able to reproduce Sam's initial problem. > > "eval" as I said does not appear in the :js-globals which seems like a > mistake. -- You received this message because you are subscribed to the Google Groups "Clojure" group. T

Re: CLJS Function clobbering js function of same name

2014-08-04 Thread Thomas Heller
I was not able to reproduce Sam's initial problem. "eval" as I said does not appear in the :js-globals which seems like a mistake. -- 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 tha

Re: CLJS Function clobbering js function of same name

2014-08-04 Thread Herwig Hochleitner
I dug a bit deeper to see where :js-globals came from and found the old ticket for this exact issue: http://dev.clojure.org/jira/browse/CLJS-680 I propose that we remove it, because it's unnessecary when we gensym fn names the same way as let bindings + blacklists are never a great solution, but in

Re: CLJS Function clobbering js function of same name

2014-08-04 Thread Herwig Hochleitner
That's curious, here's my console interaction: % git remote show origin * remote origin Fetch URL: git://github.com/clojure/clojurescript.git Push URL: git://github.com/clojure/clojurescript.git % git fetch origin && git checkout -b master origin/master Branch master set up to track remote b

Re: CLJS Function clobbering js function of same name

2014-08-04 Thread Thomas Heller
FWIW I was not able to reproduce this behavior? What exactly does your code look like? See the source and the compiled version: https://gist.github.com/thheller/4731f682665d38b1053c Seems to me the shadowing kicked in correctly. "eval" seems to be missing in :js-globals though. https://github.c

Re: CLJS Function clobbering js function of same name

2014-08-04 Thread Herwig Hochleitner
Ticket'd http://dev.clojure.org/jira/browse/CLJS-833 2014-08-04 0:57 GMT+02:00 David Nolen : > Ah hm, yeah I'm surprised this isn't caught by the existing shadowing > and :js-globals logic. Sure open a ticket, patch welcome of course. > > David > > On Sun, Aug 3, 2014 at 6:23 PM, Herwig Hochleit

Re: CLJS Function clobbering js function of same name

2014-08-03 Thread David Nolen
Ah hm, yeah I'm surprised this isn't caught by the existing shadowing and :js-globals logic. Sure open a ticket, patch welcome of course. David On Sun, Aug 3, 2014 at 6:23 PM, Herwig Hochleitner wrote: > To clarify on David's comment, js/console puts a literal 'console' > identifier into the gen

Re: CLJS Function clobbering js function of same name

2014-08-03 Thread Herwig Hochleitner
To clarify on David's comment, js/console puts a literal 'console' identifier into the generated js. In your example, js/console is shadowed, because (defn console[] js/console) is emitted as ns.console = (function console(){return console;}); The discussion to be had here is whether the (interna

Re: CLJS Function clobbering js function of same name

2014-08-01 Thread David Nolen
js/foo does not resolve to the global namespace. David On Thu, Jul 31, 2014 at 9:42 AM, Sam Ritchie wrote: > Hey guys, > > I ran into this last night when trying to port some ancient JS in our > project over to cljs. I was defining an om component called > "users-typeahead", and in the (did-moun