Re: Clojurescript output effect
Ah, figured it out. First, its important to use the debugging tools in chrome when working on javascript (Shift+Ctrl+I). This gave me the error I needed to figure what was going wrong. The problem was I needed the goog.addDependency line. Now it knows where to find it and doesn't cause an error. Best, Brent On Sep 27, 8:51 pm, Brent Millare brent.mill...@gmail.com wrote: Also as for compile options, there are none. I initially tried advanced, but again got a blank page. So I tried no args, and it made the out folder. I looked in there and saw the generated js file. I looked through that, and edited each line to look like my working js code. In the end, translating the require is what seemed to prevent the behavior. -Brent On Sep 27, 7:26 pm, Brent Millare brent.mill...@gmail.com wrote: You can try out the code I posted, but basically I wanted to create a hello world canvas. Without the require, I get the canvas. With the require, I get a blank white page. There isn't any error message, which is what made this particularly difficult to narrow. -Brent On Sep 27, 7:01 pm, David Nolen dnolen.li...@gmail.com wrote: What was the error and what were your compile options? On Tuesday, September 27, 2011, Brent Millare brent.mill...@gmail.com wrote: I'm trying to figure out why when I require('cljs.core') in a javascript file, the hello world example doesn't work. hello.js goog.require('cljs.core'); ;;--- If I delete this line, then everything works. goog.require('goog.dom'); function sayHi() { var myc__2284 = goog.dom.createDom(canvas, {width:300,height:225,style:border:1px dotted}); var context__2285 = myc__2284.getContext(2d); context__2285.font = bold 12px sans-serif; context__2285.fillText(hello wurld,50,50); return goog.dom.appendChild(document.body,myc__2284); }; index.html !DOCTYPE html html head script type=text/javascript src=goog/base.js/script script type=text/javascript src=hello.js/script /head body onload=sayHi() /body /html I was trying to cut away at what clojurescript outputs since I was trying to rule out what line was breaking the code. And oddly enough, it was the require line. What's going on here? -- 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 -- 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
Re: Clojurescript output effect
@David Nolen, All the files are there in the script tab. autogen'd file out/F6baq.js: goog.provide('hello'); goog.require('cljs.core'); hello.greet = (function greet(){ return hello world; }); goog.exportSymbol('hello.greet', hello.greet); hello.js: goog.addDependency(../cljs/core.js, ['cljs.core'], ['goog.string', 'goog.string.StringBuffer', 'goog.object', 'goog.array']); goog.addDependency(../F6baq.js, ['hello'], ['cljs.core']); @David Powell, I added meta charset=UTF-8 and I got no effect. -- 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
Re: Clojurescript output effect
Does it work when you use the advanced compilation settings? On Wed, Sep 28, 2011 at 12:35 PM, Brent Millare brent.mill...@gmail.comwrote: @David Nolen, All the files are there in the script tab. autogen'd file out/F6baq.js: goog.provide('hello'); goog.require('cljs.core'); hello.greet = (function greet(){ return hello world; }); goog.exportSymbol('hello.greet', hello.greet); hello.js: goog.addDependency(../cljs/core.js, ['cljs.core'], ['goog.string', 'goog.string.StringBuffer', 'goog.object', 'goog.array']); goog.addDependency(../F6baq.js, ['hello'], ['cljs.core']); @David Powell, I added meta charset=UTF-8 and I got no effect. -- 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 -- 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
Re: Clojurescript output effect
No, I get a similar error, but instead of hello not being defined, it says b is not defined. On Sep 28, 12:55 pm, David Nolen dnolen.li...@gmail.com wrote: Does it work when you use the advanced compilation settings? On Wed, Sep 28, 2011 at 12:35 PM, Brent Millare brent.mill...@gmail.comwrote: @David Nolen, All the files are there in the script tab. autogen'd file out/F6baq.js: goog.provide('hello'); goog.require('cljs.core'); hello.greet = (function greet(){ return hello world; }); goog.exportSymbol('hello.greet', hello.greet); hello.js: goog.addDependency(../cljs/core.js, ['cljs.core'], ['goog.string', 'goog.string.StringBuffer', 'goog.object', 'goog.array']); goog.addDependency(../F6baq.js, ['hello'], ['cljs.core']); @David Powell, I added meta charset=UTF-8 and I got no effect. -- 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 -- 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
Re: Clojurescript output effect
Did you try this wIthout a single element namespace? On Wednesday, September 28, 2011, Brent Millare brent.mill...@gmail.com wrote: No, I get a similar error, but instead of hello not being defined, it says b is not defined. On Sep 28, 12:55 pm, David Nolen dnolen.li...@gmail.com wrote: Does it work when you use the advanced compilation settings? On Wed, Sep 28, 2011 at 12:35 PM, Brent Millare brent.mill...@gmail.com wrote: @David Nolen, All the files are there in the script tab. autogen'd file out/F6baq.js: goog.provide('hello'); goog.require('cljs.core'); hello.greet = (function greet(){ return hello world; }); goog.exportSymbol('hello.greet', hello.greet); hello.js: goog.addDependency(../cljs/core.js, ['cljs.core'], ['goog.string', 'goog.string.StringBuffer', 'goog.object', 'goog.array']); goog.addDependency(../F6baq.js, ['hello'], ['cljs.core']); @David Powell, I added meta charset=UTF-8 and I got no effect. -- 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 -- 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 -- 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
Re: Clojurescript output effect
Hi David, I'm not sure what you mean by this. If I replace hello.greet() with greet(), I get greet is not defined instead. On Sep 28, 2:03 pm, David Nolen dnolen.li...@gmail.com wrote: Did you try this wIthout a single element namespace? On Wednesday, September 28, 2011, Brent Millare brent.mill...@gmail.com wrote: No, I get a similar error, but instead of hello not being defined, it says b is not defined. On Sep 28, 12:55 pm, David Nolen dnolen.li...@gmail.com wrote: Does it work when you use the advanced compilation settings? On Wed, Sep 28, 2011 at 12:35 PM, Brent Millare brent.mill...@gmail.com wrote: @David Nolen, All the files are there in the script tab. autogen'd file out/F6baq.js: goog.provide('hello'); goog.require('cljs.core'); hello.greet = (function greet(){ return hello world; }); goog.exportSymbol('hello.greet', hello.greet); hello.js: goog.addDependency(../cljs/core.js, ['cljs.core'], ['goog.string', 'goog.string.StringBuffer', 'goog.object', 'goog.array']); goog.addDependency(../F6baq.js, ['hello'], ['cljs.core']); @David Powell, I added meta charset=UTF-8 and I got no effect. -- 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 -- 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 -- 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
Re: Clojurescript output effect
Change you project layout to something like this: src/hello/core.cljs And put the code currently in hello.cljs in core.cljs Make the other relevant changes to account for this restructuring. Whenever I encounter issues like the one you're experiencing I try to compare against the working samples in the repo. David On Wed, Sep 28, 2011 at 2:47 PM, Brent Millare brent.mill...@gmail.comwrote: Hi David, I'm not sure what you mean by this. If I replace hello.greet() with greet(), I get greet is not defined instead. On Sep 28, 2:03 pm, David Nolen dnolen.li...@gmail.com wrote: Did you try this wIthout a single element namespace? On Wednesday, September 28, 2011, Brent Millare brent.mill...@gmail.com wrote: No, I get a similar error, but instead of hello not being defined, it says b is not defined. On Sep 28, 12:55 pm, David Nolen dnolen.li...@gmail.com wrote: Does it work when you use the advanced compilation settings? On Wed, Sep 28, 2011 at 12:35 PM, Brent Millare brent.mill...@gmail.com wrote: @David Nolen, All the files are there in the script tab. autogen'd file out/F6baq.js: goog.provide('hello'); goog.require('cljs.core'); hello.greet = (function greet(){ return hello world; }); goog.exportSymbol('hello.greet', hello.greet); hello.js: goog.addDependency(../cljs/core.js, ['cljs.core'], ['goog.string', 'goog.string.StringBuffer', 'goog.object', 'goog.array']); goog.addDependency(../F6baq.js, ['hello'], ['cljs.core']); @David Powell, I added meta charset=UTF-8 and I got no effect. -- 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 -- 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 -- 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 -- 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
Clojurescript output effect
I'm trying to figure out why when I require('cljs.core') in a javascript file, the hello world example doesn't work. hello.js goog.require('cljs.core'); ;;--- If I delete this line, then everything works. goog.require('goog.dom'); function sayHi() { var myc__2284 = goog.dom.createDom(canvas, {width:300,height:225,style:border:1px dotted}); var context__2285 = myc__2284.getContext(2d); context__2285.font = bold 12px sans-serif; context__2285.fillText(hello wurld,50,50); return goog.dom.appendChild(document.body,myc__2284); }; index.html !DOCTYPE html html head script type=text/javascript src=goog/base.js/script script type=text/javascript src=hello.js/script /head body onload=sayHi() /body /html I was trying to cut away at what clojurescript outputs since I was trying to rule out what line was breaking the code. And oddly enough, it was the require line. What's going on here? -- 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
Re: Clojurescript output effect
What was the error and what were your compile options? On Tuesday, September 27, 2011, Brent Millare brent.mill...@gmail.com wrote: I'm trying to figure out why when I require('cljs.core') in a javascript file, the hello world example doesn't work. hello.js goog.require('cljs.core'); ;;--- If I delete this line, then everything works. goog.require('goog.dom'); function sayHi() { var myc__2284 = goog.dom.createDom(canvas, {width:300,height:225,style:border:1px dotted}); var context__2285 = myc__2284.getContext(2d); context__2285.font = bold 12px sans-serif; context__2285.fillText(hello wurld,50,50); return goog.dom.appendChild(document.body,myc__2284); }; index.html !DOCTYPE html html head script type=text/javascript src=goog/base.js/script script type=text/javascript src=hello.js/script /head body onload=sayHi() /body /html I was trying to cut away at what clojurescript outputs since I was trying to rule out what line was breaking the code. And oddly enough, it was the require line. What's going on here? -- 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 -- 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
Re: Clojurescript output effect
You can try out the code I posted, but basically I wanted to create a hello world canvas. Without the require, I get the canvas. With the require, I get a blank white page. There isn't any error message, which is what made this particularly difficult to narrow. -Brent On Sep 27, 7:01 pm, David Nolen dnolen.li...@gmail.com wrote: What was the error and what were your compile options? On Tuesday, September 27, 2011, Brent Millare brent.mill...@gmail.com wrote: I'm trying to figure out why when I require('cljs.core') in a javascript file, the hello world example doesn't work. hello.js goog.require('cljs.core'); ;;--- If I delete this line, then everything works. goog.require('goog.dom'); function sayHi() { var myc__2284 = goog.dom.createDom(canvas, {width:300,height:225,style:border:1px dotted}); var context__2285 = myc__2284.getContext(2d); context__2285.font = bold 12px sans-serif; context__2285.fillText(hello wurld,50,50); return goog.dom.appendChild(document.body,myc__2284); }; index.html !DOCTYPE html html head script type=text/javascript src=goog/base.js/script script type=text/javascript src=hello.js/script /head body onload=sayHi() /body /html I was trying to cut away at what clojurescript outputs since I was trying to rule out what line was breaking the code. And oddly enough, it was the require line. What's going on here? -- 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 -- 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
Re: Clojurescript output effect
Also as for compile options, there are none. I initially tried advanced, but again got a blank page. So I tried no args, and it made the out folder. I looked in there and saw the generated js file. I looked through that, and edited each line to look like my working js code. In the end, translating the require is what seemed to prevent the behavior. -Brent On Sep 27, 7:26 pm, Brent Millare brent.mill...@gmail.com wrote: You can try out the code I posted, but basically I wanted to create a hello world canvas. Without the require, I get the canvas. With the require, I get a blank white page. There isn't any error message, which is what made this particularly difficult to narrow. -Brent On Sep 27, 7:01 pm, David Nolen dnolen.li...@gmail.com wrote: What was the error and what were your compile options? On Tuesday, September 27, 2011, Brent Millare brent.mill...@gmail.com wrote: I'm trying to figure out why when I require('cljs.core') in a javascript file, the hello world example doesn't work. hello.js goog.require('cljs.core'); ;;--- If I delete this line, then everything works. goog.require('goog.dom'); function sayHi() { var myc__2284 = goog.dom.createDom(canvas, {width:300,height:225,style:border:1px dotted}); var context__2285 = myc__2284.getContext(2d); context__2285.font = bold 12px sans-serif; context__2285.fillText(hello wurld,50,50); return goog.dom.appendChild(document.body,myc__2284); }; index.html !DOCTYPE html html head script type=text/javascript src=goog/base.js/script script type=text/javascript src=hello.js/script /head body onload=sayHi() /body /html I was trying to cut away at what clojurescript outputs since I was trying to rule out what line was breaking the code. And oddly enough, it was the require line. What's going on here? -- 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 -- 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