[ClojureScript] A ClojureScript Tutorial For Light Table Users

2014-01-15 Thread David Nolen
I've started what I hope will be a collaborative and comprehensive reference on the ClojureScript language for people looking to extend Light Table. This is a file that can be directly evaluated in the Light Table UI Connection. http://swannodette.github.io/2014/01/15/clojurescript-for-light-table-

[ClojureScript] [Om] How to manage state

2014-01-15 Thread Ruslan Prokopchuk
I'm struggling for best solution in the following case: I have component representing svg node with some content which has to be centered in it and having some other properties derived from node dimensions. To achieve this I created listener for window resize which update state of component wit

Re: [ClojureScript] [Om] How to manage state

2014-01-15 Thread David Nolen
I don't see the problem with flowing layout information down the tree. David On Wed, Jan 15, 2014 at 8:55 AM, Ruslan Prokopchuk wrote: > I'm struggling for best solution in the following case: > > I have component representing svg node with some content which has to be > centered in it and havi

Re: [ClojureScript] [Om] How to manage state

2014-01-15 Thread Ruslan Prokopchuk
David, but is it ok to update component & app state in render? My knowledge about Om/React is still very incomplete, so I don't understand fully how things should be organized. -- Note that posts from new members are moderated - please be patient with your first post. --- You received this me

Re: [ClojureScript] [Om] How to manage state

2014-01-15 Thread David Nolen
It's ok to update component local state during render via om/set-state!, I don't see a good use case for updating global application state from render. david On Wed, Jan 15, 2014 at 9:09 AM, Ruslan Prokopchuk wrote: > David, but is it ok to update component & app state in render? My > knowledge

Re: [ClojureScript] [Om] How to manage state

2014-01-15 Thread Ruslan Prokopchuk
Component is dropped by user near some position, in render this component sees it and snaps itself to this position. Then component and position ids should be reported to app global state. I've done it in render, but now I think about putting message with ids into core.async channel and process

Re: [ClojureScript] [Om] How to manage state

2014-01-15 Thread Laurent PETIT
2014/1/15 David Nolen > It's ok to update component local state during render via om/set-state!, I > don't see a good use case for updating global application state from render. > > david > Shouldn't that be considered a very bad smell ? > > > On Wed, Jan 15, 2014 at 9:09 AM, Ruslan Prokopc

[ClojureScript] Problem with clj->js

2014-01-15 Thread Александр Шер
Hello! I have a problem using clj->js. It returns nil for numbers and strings. Proof: http://gyazo.com/2939aabccabbc69e68f65c8073a71da1 Any ideas & help? -- Note that posts from new members are moderated - please be patient with your first post. --- You received this message because you are su

Re: [ClojureScript] [Om] How to manage state

2014-01-15 Thread David Nolen
Yes. On Wednesday, January 15, 2014, Laurent PETIT wrote: > > 2014/1/15 David Nolen 'dnolen.li...@gmail.com');>> > >> It's ok to update component local state during render via om/set-state!, >> I don't see a good use case for updating global application state from >> render. >> >> david >> > > >

Re: [ClojureScript] [Om] How to manage state

2014-01-15 Thread David Nolen
Yes I've found that using channels to communicate back up the tree and propagating changes back down works reasonably well. Just takes some getting used to. On Wednesday, January 15, 2014, Ruslan Prokopchuk wrote: > Component is dropped by user near some position, in render this component > sees

Re: [ClojureScript] Problem with clj->js

2014-01-15 Thread David Nolen
I cannot replicate this, we need more information about your particular setup. What version of ClojureScript? Did you make sure to run `lein cljsbuild clean` on your project? On Wed, Jan 15, 2014 at 9:16 AM, Александр Шер wrote: > Hello! I have a problem using clj->js. It returns nil for numbers

Re: [ClojureScript] A ClojureScript Tutorial For Light Table Users

2014-01-15 Thread gvim
I'm not having much luck with this. I opened a LightTable UI connection then opened the lt-cljs-tutorial.cljs file from within the Workspace sidebar. When I placed the cursor after this form: (def x 1) x it evaluated to 'nil'. I'm using the Vim syntax extension, if that makes any differe

Re: [ClojureScript] A ClojureScript Tutorial For Light Table Users

2014-01-15 Thread Chris Granger
@David Awesome work :) @gvim You need to eval (def x 1) first. Cheers, Chris. On Wed, Jan 15, 2014 at 9:45 AM, gvim wrote: > I'm not having much luck with this. I opened a LightTable UI connection > then opened the lt-cljs-tutorial.cljs file from within the Workspace > sidebar. When I placed

Re: [ClojureScript] [ANN] cljs-start 0.1.1

2014-01-15 Thread gvim
When you say "Clojurescript lib" do you mean a project because your example begins with starting a project, not a lib. I understand a lib to mean something included in a project or web app, not the project/app itself. These things can confuse a beginner. I also have no idea, from the git notes,

[ClojureScript] Fun map over keyword

2014-01-15 Thread Ruslan Prokopchuk
cljs.user=> (map identity :x) (: "'" "x") -- Note that posts from new members are moderated - please be patient with your first post. --- You received this message because you are subscribed to the Google Groups "ClojureScript" group. To unsubscribe from this group and stop receiving emails fr

Re: [ClojureScript] Fun map over keyword

2014-01-15 Thread David Nolen
This throws an error and has for a long time now. What version of ClojureScript are you using? On Wed, Jan 15, 2014 at 12:46 PM, Ruslan Prokopchuk wrote: > cljs.user=> (map identity :x) > (: "'" "x") > > -- > Note that posts from new members are moderated - please be patient with > your first po

Re: [ClojureScript] Fun map over keyword

2014-01-15 Thread Ruslan Prokopchuk
I can't figure out version which is used here http://www.clojurescript.net/ but it seems about a year old after looking on files at github. -- Note that posts from new members are moderated - please be patient with your first post. --- You received this message because you are subscribed to th

Re: [ClojureScript] Fun map over keyword

2014-01-15 Thread David Nolen
clojurescript.net is a fork that can bootstrap to JavaScript. It's pretty disconnected from mainline ClojureScript development. David On Wed, Jan 15, 2014 at 1:04 PM, Ruslan Prokopchuk wrote: > I can't figure out version which is used here > http://www.clojurescript.net/ but it seems about a ye

Re: [ClojureScript] [ANN] cljs-start 0.1.1

2014-01-15 Thread Mimmo Cosenza
A project is the map you get when you pprint it. A view of a project is the map you get when you pprint it with the corresponding profile (with-profiles). A CLJS lib is a project too, but you only use the CLJS subset of CLJS, a part from macros, because you're targeting the JS platform only (be

[ClojureScript] Re: A ClojureScript Tutorial For Light Table Users

2014-01-15 Thread David Nolen
Control-SPACE to open the command pane. Type "Add Connection" and select it. Choose Light Table UI. You should now be able to evaluate forms in the tutorial. On Wed, Jan 15, 2014 at 6:54 PM, Mark wrote: > The concept seems cool but I can't figure out the mechanics. What are the > magic keystrok

[ClojureScript] Re: A ClojureScript Tutorial For Light Table Users

2014-01-15 Thread Mark
The concept seems cool but I can't figure out the mechanics. What are the magic keystrokes to directly evaluate in the Light Table UI Connection? On Wednesday, January 15, 2014 5:44:06 AM UTC-8, David Nolen wrote: > > I've started what I hope will be a collaborative and comprehensive > reference

[ClojureScript] monet ?

2014-01-15 Thread boz jennings
Hi, Can someone give me pointers on using monet? I'm trying to get to know Clojurescript. Just cloned cljs-start and put in dependencies and changes that I hope will work for monet https://github.com/rm-hull/monet But I get this when compiling WARNING: Wrong number of args (2) passed to monet

[ClojureScript] Re: A ClojureScript Tutorial For Light Table Users

2014-01-15 Thread Mark
Ok, thanks. I was thinking of something a bit different: connecting directly to the URL On Wednesday, January 15, 2014 5:34:58 PM UTC-8, David Nolen wrote: > > Control-SPACE to open the command pane. Type "Add Connection" and select > it. Choose Light Table UI. You should now be able to evalu