[ClojureScript] Re: Reagent: how do I add drag and drop event listeners properly?
On Tuesday, April 8, 2014 5:43:12 PM UTC-4, lei shulang wrote: > I get that I can add :on-click etc. directly in hiccup. But how do I add drag > and drop event listeners properly? The same way you would for other events, such as your :on-click example. Here's a little something to get you started: https://www.refheap.com/73581 Also, getting info from things *while* you are dragging can be quite difficult. I'd suggest using storage-atom for this: https://github.com/alandipert/storage-atom. It plays quite well with Reagent. -- 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 from it, send an email to clojurescript+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
Re: [ClojureScript] Wrong script order
Thanks! I somehow had Javascript in mind... where you don't declare the dependencies (kinda overlooked the :require part in my scripts). But it makes sense ;) Am Montag, 7. April 2014 14:54:52 UTC+2 schrieb Moritz Ulrich: > The problem here seems to be that Clojurescript doesn't know anything > > about the dependencies of your application. Try adding a :require > > statement. > > > > On Sun, Apr 6, 2014 at 6:42 PM, Ivan Schuetz wrote: > > > I have a cljs file that depends on another. But the compiled script is > > inserting the scripts in the wrong order. So when this code tries to access > > some functionality which was initialized in the second file, it throws an > > error. > > > > > > How is the ordering determined? Is there any way to change this? > > > > > > These are my scripts. It's an AngularJS application. > > > > > > app.cljs - here I declare AngularJS module, which I'll retrieve in the > > other.cljs: > > > > > > (ns myapp.mainscript > > > (:require [jayq.core :as jq]) > > > (:use [jayq.core :only [$]] > > > [clojure.string :only [blank?]]) > > > ) > > > > > > (let [app (-> js/angular > > >(.module "myproj" ["myproj.controllers"]))]) > > > > > > > > > other.cljs: > > > > > > (ns myapp.other > > > (:require [jayq.core :as jq]) > > > (:use [jayq.core :only [$]] > > > [clojure.string :only [blank?]]) > > > ) > > > > > > > > > (def app (-> js/angular (.module "myproj"))) > > > > > > (println app) > > > > > > > > > This is generated JS - the first script is in the last line app_6414 = ... > > > > > > myapp.add_product_controller.app = angular.module("myproj"); > > > cljs.core.println.call(null, myapp.add_product_controller.app); > > > myapp.mainscript = {}; > > > var app__6414 = angular.module("myproj", > > cljs.core.PersistentVector.fromArray(["myproj.controllers"], !0)); > > > > > > > > > For I moment I thought the ordering could be related to my use of variables > > "app", but these should be independent of each other. > > > > > > What's the problem here? how can I fix this? > > > > > > -- > > > 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 from it, send an > > email to clojurescript+unsubscr...@googlegroups.com. > > > To post to this group, send email to clojurescript@googlegroups.com. > > > Visit this group at http://groups.google.com/group/clojurescript. -- 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 from it, send an email to clojurescript+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
[ClojureScript] Reagent: how do I add drag and drop event listeners properly?
I get that I can add :on-click etc. directly in hiccup. But how do I add drag and drop event listeners properly? -- 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 from it, send an email to clojurescript+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
[ClojureScript] Error Running Advanced Unit Tests of Modern ClojureScript Tutorial
I'm working through the (great!) Modern ClojureScript tutorials. I'm working on tutorial 16. I'm in the section named "Dancing alone on the client-side of the browser." When I run the ClojureScript unit tests, the whitespace tests and the simple tests pass, but the advanced tests fail. Because of all the changes made by the Google Closure Compiler, I'm uncertain how to even start diagnosing this issue. I've tried to follow the tutorial steps faithfully; however, I have included the most up-to-date of the various libraries mentioned in the tutorial. I did try reverting back to clojurescript.test to 0.2.1 and I see similar (but not identical) behavior. I've attached my project.clj file for information. What recent experience have others had running unit tests in these three different configurations? Thanks. -- 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 from it, send an email to clojurescript+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript. project.clj Description: Binary data
Re: [ClojureScript] Re: Om cursors explained
On Tue, Apr 8, 2014 at 3:40 PM, Jonas Enlund wrote: > I too have been thinking about the concept of cursors. > > Cursors are meant to enable reusable components but the way I see it they > can easily couple your view code with the rest of your program (they are > mutable and are meant to be used that way). If every component takes (and > uses) a cursor are we back to a network of mutable stuff? > No. In Om you have a database-like system + time model. > I think you can achieve the same level of reuse with either callbacks or > channels. As a simple example should a button component expose an on-click > event (or a click channel) or fiddle with application state directly via > cursors, which is more reusable? > I'm of the opinion now that channels are great for application developers. Not good for components, components should probably always take callbacks as their exposed communication interface. It's easy to add async channels over that. > I suppose it’s possible to not use cursors when you don’t have to and I > think that in many cases it’s better for components to not handle state > changes directly themselves and instead emit (either via channels or > callbacks) data about user interactions which can be handled separately by > a different part of your program. Components do not handle state changes themselves, they request state changes via cursors. Cursors handle state changes and cursors are a customizable abstraction by the user. If you want a component to write its state elsewhere go for it. People continue to think that cursors do both more and less than they actually do. I encourage people to actual read and fully understand source before coming to any conclusions as to their purpose. David -- 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 from it, send an email to clojurescript+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
[ClojureScript] Re: Om cursors explained
I too have been thinking about the concept of cursors. Cursors are meant to enable reusable components but the way I see it they can easily couple your view code with the rest of your program (they are mutable and are meant to be used that way). If every component takes (and uses) a cursor are we back to a network of mutable stuff? I think you can achieve the same level of reuse with either callbacks or channels. As a simple example should a button component expose an on-click event (or a click channel) or fiddle with application state directly via cursors, which is more reusable? I suppose it’s possible to not use cursors when you don’t have to and I think that in many cases it’s better for components to not handle state changes directly themselves and instead emit (either via channels or callbacks) data about user interactions which can be handled separately by a different part of your program. On Tuesday, April 8, 2014 9:43:38 PM UTC+3, Nikita Prokopov wrote: > Hi! > > > > I’ve tried to get through Om tutorials and cursors are still most mysterious > part of it for me. I mean, idea is clear, but practice is filled with a lot > of pitfalls. > > > > I'm looking for help in understanding them. These are the questions I believe > could make nice introduction and help people like me understand the idea > fully: > > > > what’s cursor > > what operation does it support > > how and when to update the cursor, how changes are propagated to the core > state (atom) > > how to create a cursor from atom > > how to convert cursor to data > > how to create cursor from cursor > > how are cursors related to render, why render is so special for them > > how exactly component state is dependent on a cursor > > what’s the role of IValue and ICloneable in cursors life? > > why do we have to implement ICloneable on Strings (in an immutable language!) > in order for cursors to work? > > > > Looking for answers. Thanks! -- 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 from it, send an email to clojurescript+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
Re: [ClojureScript] Re: Om cursors explained
Interacting with cursors is restricted to render for *consistency*. No one should be able to mutate the data during render, it's that simple. In between renders we do not allow interacting with cursors for *consistency* beyond the few operations covered in the documentation and docstrings. This is because it's not possible to know who is changing the state between renders (outside of subscribing to :tx-listen). On Tue, Apr 8, 2014 at 3:06 PM, William Sommers wrote: > > what’s the role of IValue and ICloneable in cursors life? > Not sure. > ICloneable can be converted to cursors for free. IValue exists because for various reasons you may want to read a *stale* value in an event handler or go loop or whatever. Generally you should not do this and instead deref. deref is only allowed outside of render because of ... *consistency*. During render you have consistent picture of the world. Outside rendering you do not. > why do we have to implement ICloneable on Strings (in an immutable > language!) in order for cursors to work? > Not sure. The documentation and the tutorials now specifically state to not do this. It's only there for people who absolutely are OK with the myriad of issues around JavaScript natives versus objects for String/Number/Boolean/etc. I show this only to demonstrate it's possible achieve uniform handling of values at the leaves of your application state. I don't actually recommend it in practice. While I'm not taking pull requests on Om, documentation like this is a great place for people to start and continue contributing. Thanks, David -- 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 from it, send an email to clojurescript+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
Re: [ClojureScript] fast reduce
Yes areduce is preferred if applicable. David On Tue, Apr 8, 2014 at 3:01 PM, Yehonathan Sharvit wrote: > I have discovered that *areduce* is also very fast: > > (areduce a i res 0 (+ res (aget a i))) > > I feel that it preserves the functional programming spirit. > > Any comment on that, David? > > > > On Tue, Apr 8, 2014 at 9:44 AM, Yehonathan Sharvit wrote: > >> Thanks David! >> >> I see that ClojureScript can deal with js arrays both with: >> 1. aget and alength >> 2. get and count >> >> The first option is much much faster!!! >> >> >> >> >> On Tue, Apr 8, 2014 at 12:38 AM, David Nolen wrote: >> >>> On Mon, Apr 7, 2014 at 5:26 PM, Yehonathan Sharvit wrote: >>> (defn my-sum[a] (def res 0) (doseq [x a] (set! res (+ res x ))) res) >>> >>> def's are always top-level. Do not put def's in def's like this. >>> >>> (defn my-sum [a] >>> (loop [i 0 sum 0] >>> (if (< i (alength a)) >>> (recur (inc i) (+ sum (aget a i)) >>> sum))) >>> >>> Should give similar performance to the version you wrote in JavaScript. >>> >>> David >>> >>> -- >>> Note that posts from new members are moderated - please be patient with >>> your first post. >>> --- >>> You received this message because you are subscribed to a topic in the >>> Google Groups "ClojureScript" group. >>> To unsubscribe from this topic, visit >>> https://groups.google.com/d/topic/clojurescript/ex2GmRMQCXQ/unsubscribe. >>> To unsubscribe from this group and all its topics, send an email to >>> clojurescript+unsubscr...@googlegroups.com. >>> To post to this group, send email to clojurescript@googlegroups.com. >>> Visit this group at http://groups.google.com/group/clojurescript. >>> >> >> >> >> -- >> "Are we what we become or do we become what we are?" - Prof. Beno Gross >> > > > > -- > "Are we what we become or do we become what we are?" - Prof. Beno Gross > > -- > 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 from it, send an > email to clojurescript+unsubscr...@googlegroups.com. > To post to this group, send email to clojurescript@googlegroups.com. > Visit this group at http://groups.google.com/group/clojurescript. > -- 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 from it, send an email to clojurescript+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
[ClojureScript] Re: Om cursors explained
Hey, I hope that some of the answers are helpful. On Tuesday, April 8, 2014 2:43:38 PM UTC-4, Nikita Prokopov wrote: > Hi! > > > > I’ve tried to get through Om tutorials and cursors are still most mysterious > part of it for me. I mean, idea is clear, but practice is filled with a lot > of pitfalls. > > > > I'm looking for help in understanding them. These are the questions I believe > could make nice introduction and help people like me understand the idea > fully: > > > > what’s cursor See Below. > > what operation does it support A cursor is how you pass data around Om and how Om knows which components care about which data and therefore which components to update when the data changes. > > how and when to update the cursor, how changes are propagated to the core > state (atom) You update the cursor by using some of the methods here like transact! (https://github.com/swannodette/om/wiki/Documentation#transact) The changes are propagated up to the root cursor, however, not the core state atom. The clarify, when you pass the core state atom into om/root a root cursor is returned which is operated on for all application state changes. > > how to create a cursor from atom A cursor is created from an atom generally containing hash-map that is passed in as the "root cursor" to om/root. > > how to convert cursor to data This is done for you by om. > > how to create cursor from cursor Whenever you access an item from the cursor you are returned a new cursor which includes an updated path to the root cursor. The path is sort of like a trail of breadcrumbs that tell cursors down the app tree how to reach the root cursor. > > how are cursors related to render, why render is so special for them Not sure from your question. > > how exactly component state is dependent on a cursor Presumably the cursor for each component owns data that the component cares about and binds to. > > what’s the role of IValue and ICloneable in cursors life? Not sure. > > why do we have to implement ICloneable on Strings (in an immutable language!) > in order for cursors to work? Not sure. > > > > Looking for answers. Thanks! -- 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 from it, send an email to clojurescript+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
Re: [ClojureScript] fast reduce
I have discovered that *areduce* is also very fast: (areduce a i res 0 (+ res (aget a i))) I feel that it preserves the functional programming spirit. Any comment on that, David? On Tue, Apr 8, 2014 at 9:44 AM, Yehonathan Sharvit wrote: > Thanks David! > > I see that ClojureScript can deal with js arrays both with: > 1. aget and alength > 2. get and count > > The first option is much much faster!!! > > > > > On Tue, Apr 8, 2014 at 12:38 AM, David Nolen wrote: > >> On Mon, Apr 7, 2014 at 5:26 PM, Yehonathan Sharvit wrote: >> >>> (defn my-sum[a] >>> (def res 0) >>> (doseq [x a] >>> (set! res (+ res x ))) >>> res) >>> >> >> def's are always top-level. Do not put def's in def's like this. >> >> (defn my-sum [a] >> (loop [i 0 sum 0] >> (if (< i (alength a)) >> (recur (inc i) (+ sum (aget a i)) >> sum))) >> >> Should give similar performance to the version you wrote in JavaScript. >> >> David >> >> -- >> Note that posts from new members are moderated - please be patient with >> your first post. >> --- >> You received this message because you are subscribed to a topic in the >> Google Groups "ClojureScript" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/clojurescript/ex2GmRMQCXQ/unsubscribe. >> To unsubscribe from this group and all its topics, send an email to >> clojurescript+unsubscr...@googlegroups.com. >> To post to this group, send email to clojurescript@googlegroups.com. >> Visit this group at http://groups.google.com/group/clojurescript. >> > > > > -- > "Are we what we become or do we become what we are?" - Prof. Beno Gross > -- "Are we what we become or do we become what we are?" - Prof. Beno Gross -- 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 from it, send an email to clojurescript+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
Re: [ClojureScript] Om cursrors explained
Those are a lot of interesting questions best answered by just hunkering down and reading the source. Once you understand them please feel free to add a documentation section to the Om wiki that answers these questions if you feel inclined. A design goal of Om is for it to be small enough that more detail oriented questions not addressed by existing documentation can be quickly answered by reading some code. If you still have questions, feel free to ask for clarifications. David On Tue, Apr 8, 2014 at 2:43 PM, Nikita Prokopov wrote: > Hi! > > I’ve tried to get through Om tutorials and cursors are still most > mysterious part of it for me. I mean, idea is clear, but practice is filled > with a lot of pitfalls. > > I'm looking for help in understanding them. These are the questions I > believe could make nice introduction and help people like me understand the > idea fully: > > what’s cursor > what operation does it support > how and when to update the cursor, how changes are propagated to the core > state (atom) > how to create a cursor from atom > how to convert cursor to data > how to create cursor from cursor > how are cursors related to render, why render is so special for them > how exactly component state is dependent on a cursor > what’s the role of IValue and ICloneable in cursors life? > why do we have to implement ICloneable on Strings (in an immutable > language!) in order for cursors to work? > > Looking for answers. Thanks! > > -- > 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 from it, send an > email to clojurescript+unsubscr...@googlegroups.com. > To post to this group, send email to clojurescript@googlegroups.com. > Visit this group at http://groups.google.com/group/clojurescript. > -- 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 from it, send an email to clojurescript+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
[ClojureScript] Om cursors explained
Hi! I’ve tried to get through Om tutorials and cursors are still most mysterious part of it for me. I mean, idea is clear, but practice is filled with a lot of pitfalls. I'm looking for help in understanding them. These are the questions I believe could make nice introduction and help people like me understand the idea fully: what’s cursor what operation does it support how and when to update the cursor, how changes are propagated to the core state (atom) how to create a cursor from atom how to convert cursor to data how to create cursor from cursor how are cursors related to render, why render is so special for them how exactly component state is dependent on a cursor what’s the role of IValue and ICloneable in cursors life? why do we have to implement ICloneable on Strings (in an immutable language!) in order for cursors to work? Looking for answers. Thanks! -- 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 from it, send an email to clojurescript+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
[ClojureScript] Om cursrors explained
Hi! I’ve tried to get through Om tutorials and cursors are still most mysterious part of it for me. I mean, idea is clear, but practice is filled with a lot of pitfalls. I'm looking for help in understanding them. These are the questions I believe could make nice introduction and help people like me understand the idea fully: what’s cursor what operation does it support how and when to update the cursor, how changes are propagated to the core state (atom) how to create a cursor from atom how to convert cursor to data how to create cursor from cursor how are cursors related to render, why render is so special for them how exactly component state is dependent on a cursor what’s the role of IValue and ICloneable in cursors life? why do we have to implement ICloneable on Strings (in an immutable language!) in order for cursors to work? Looking for answers. Thanks! -- 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 from it, send an email to clojurescript+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
Re: [ClojureScript] Ran tests with v20140417
pom.template.xml is what we change to update dependencies. David On Tue, Apr 8, 2014 at 12:41 PM, Tim Visher wrote: > On Tue, Apr 8, 2014 at 12:06 PM, David Nolen > wrote: > > In order to test the new Closure compiler you need to update the > bootstrap > > script to download the right jar. The project.clj is only for development > > and is not actually involved in managing ClojureScript dependencies in > > anyway. > > Interesting. Reading through script/bootstrap, it appears that we > always downloads latest during bootstrap, which would indicate that > we're not actually depending on a specific version of the > closure-compiler? > > Would I edit the pom.xml file to update the dependency? > > Anyway, I re-ran it and: > > $ java -jar lib/compiler.jar --version > Closure Compiler (http://code.google.com/closure/compiler) > Version: v20140407 > Built on: 2014/04/07 14:04 > > $ V8_HOME=/usr/local/bin SPIDERMONKEY_HOME=/usr/local/bin > JSC_HOME=/usr/local/bin script/test > Testing with V8 > Tests completed without exception > > > Testing with SpiderMonkey > out/core-advanced-test.js:533: Error: Assert failed: (not (integer? > 1e+308)) > Testing with JavaScriptCore > Tests completed without exception > > > NASHORN_HOME not set, skipping Nashorn tests > Tested with 3 out of 4 possible js targets > > -- > > In Christ, > > Timmy V. > > http://blog.twonegatives.com/ > http://five.sentenc.es/ -- Spend less time on mail > > -- > 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 from it, send an > email to clojurescript+unsubscr...@googlegroups.com. > To post to this group, send email to clojurescript@googlegroups.com. > Visit this group at http://groups.google.com/group/clojurescript. > -- 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 from it, send an email to clojurescript+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
Re: [ClojureScript] Ran tests with v20140417
On Tue, Apr 8, 2014 at 12:06 PM, David Nolen wrote: > In order to test the new Closure compiler you need to update the bootstrap > script to download the right jar. The project.clj is only for development > and is not actually involved in managing ClojureScript dependencies in > anyway. Interesting. Reading through script/bootstrap, it appears that we always downloads latest during bootstrap, which would indicate that we're not actually depending on a specific version of the closure-compiler? Would I edit the pom.xml file to update the dependency? Anyway, I re-ran it and: $ java -jar lib/compiler.jar --version Closure Compiler (http://code.google.com/closure/compiler) Version: v20140407 Built on: 2014/04/07 14:04 $ V8_HOME=/usr/local/bin SPIDERMONKEY_HOME=/usr/local/bin JSC_HOME=/usr/local/bin script/test Testing with V8 Tests completed without exception Testing with SpiderMonkey out/core-advanced-test.js:533: Error: Assert failed: (not (integer? 1e+308)) Testing with JavaScriptCore Tests completed without exception NASHORN_HOME not set, skipping Nashorn tests Tested with 3 out of 4 possible js targets -- In Christ, Timmy V. http://blog.twonegatives.com/ http://five.sentenc.es/ -- Spend less time on mail -- 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 from it, send an email to clojurescript+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
Re: [ClojureScript] Ran tests with v20140417
In order to test the new Closure compiler you need to update the bootstrap script to download the right jar. The project.clj is only for development and is not actually involved in managing ClojureScript dependencies in anyway. David On Tue, Apr 8, 2014 at 9:15 AM, Tim Visher wrote: > Hi All, > > v20140417 was just released to Maven Central. > > With the following patch: > > diff --git a/project.clj b/project.clj > index d80ceef..0afea52 100644 > --- a/project.clj > +++ b/project.clj > @@ -12,7 +12,7 @@ > [org.clojure/data.json "0.2.3"] > [org.clojure/tools.reader "0.8.3"] > [org.clojure/google-closure-library > "0.0-20130212-95c19e7f0f5f"] > - [com.google.javascript/closure-compiler "v20131014"] > + [com.google.javascript/closure-compiler "v20140407"] > [org.mozilla/rhino "1.7R4"]] >:profiles {:1.5 {:dependencies [[org.clojure/clojure "1.5.1"]]} > :1.6 {:dependencies [[org.clojure/clojure > "1.6.0-master-SNAPSHOT"]]}} > > I ran: > > $ V8_HOME=/usr/local/bin SPIDERMONKEY_HOME=/usr/local/bin > JSC_HOME=/usr/local/bin script/t > est > Testing with V8 > Tests completed without exception > > > Testing with SpiderMonkey > out/core-advanced-test.js:533: Error: Assert failed: (not (integer? > 1e+308)) > Testing with JavaScriptCore > Tests completed without exception > > > NASHORN_HOME not set, skipping Nashorn tests > Tested with 3 out of 4 possible js targets > > Just FYI! :) > > -- > > In Christ, > > Timmy V. > > http://blog.twonegatives.com/ > http://five.sentenc.es/ -- Spend less time on mail > > -- > 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 from it, send an > email to clojurescript+unsubscr...@googlegroups.com. > To post to this group, send email to clojurescript@googlegroups.com. > Visit this group at http://groups.google.com/group/clojurescript. > -- 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 from it, send an email to clojurescript+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
Re: [ClojureScript] Javascript arrays
The keming article was also my starting point, also the motivation to use angular :-) On Tue, Apr 8, 2014 at 10:38 AM, szx wrote: > see http://keminglabs.com/blog/angular-cljs-weather-app/ for an example > of how to extend ILookup to js objects. > > On Tuesday, April 8, 2014 7:27:56 AM UTC-4, Gary Trakhman wrote: > > you can use aget, get requires ILookup. > > > > > > > > On Tue, Apr 8, 2014 at 2:42 AM, Yehonathan Sharvit > wrote: > > > > > > > > Also, in Clojure on the JVM get works with Java Maps, while in > Clojurescript get doesn't work with js object. > > > > > > Is there a reason for that? > > > > > > > > > > > > > > On Mon, Apr 7, 2014 at 11:00 PM, Yehonathan Sharvit > wrote: > > > > > > > > > > > > What about js typed arrays? > > > > > > > > Why (array? (js/Float32Array. 3)) is false. > > > > > > > > > > > > > > (IndexedSeq. (js/Float32Array. 3) 0) seems to work fine. > > > > > > > > > > > > Will it be safe to modify array? so that it returns true for js typed > arrays? > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > On Mon, Apr 7, 2014 at 7:09 PM, David Nolen wrote: > > > > > > > > > > We will not. The handling of arrays is in correspondence with Clojure on > the JVM. > > > > > > David > > > > > > > > > > On Mon, Apr 7, 2014 at 12:05 PM, Yehonathan Sharvit > wrote: > > > > > > > > > > > > Great! > > > > > > > > Will you consider doing the same with javascript objects? > > > > > > > > > > On Monday, 7 April 2014 00:05:32 UTC+3, David Nolen wrote: > > > > > Yes JavaScript arrays work with all of the sequence functions. > > > > > > > > > > > > > > > David > > > > > > > > > > > > > > > > > > > > > > On Sun, Apr 6, 2014 at 3:11 PM, Yehonathan Sharvit > wrote: > > > > > > > > > > I was surprised when I discovered that the following code worked: > > > > > > > > > > > > > > > > > > > > (some #{2} (clj->js [1 2])) > > > > > > > > > > (count (clj->js [1 2])) > > > > > > > > > > > > > > > > > > > > My question is: Could javascript arrays be safely passed to core > functions that received a vector? > > > > > > > > > > > > > > > > > > > > -- > > > > > > > > > > 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 from it, send > an email to clojurescrip...@googlegroups.com. > > > > > > > > > > To post to this group, send email to clojur...@googlegroups.com. > > > > > > > > > > > > > > > > Visit this group at http://groups.google.com/group/clojurescript. > > > > > > > > -- > > > > 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 from it, send > an email to clojurescrip...@googlegroups.com. > > > > > > > > To post to this group, send email to clojur...@googlegroups.com. > > > > Visit this group at http://groups.google.com/group/clojurescript. > > > > > > > > > > > > > > > > > > > > -- > > > > Note that posts from new members are moderated - please be patient with > your first post. > > > > --- > > > > You received this message because you are subscribed to a topic in the > Google Groups "ClojureScript" group. > > > > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/clojurescript/R3O2aKXpsEY/unsubscribe. > > > > To unsubscribe from this group and all its topics, send an email to > clojurescrip...@googlegroups.com. > > > > To post to this group, send email to clojur...@googlegroups.com. > > > > Visit this group at http://groups.google.com/group/clojurescript. > > > > > > > > > > > > -- > > > > > > "Are we what we become or do we become what we are?" - Prof. Beno Gross > > > > > > > > > > > > > > > > > > -- > > > > > > "Are we what we become or do we become what we are?" - Prof. Beno Gross > > > > > > > > > > > > > > -- > > > > 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 from it, send > an email to clojurescrip...@googlegroups.com. > > > > To post to this group, send email to clojur...@googlegroups.com. > > > > Visit this group at http://groups.google.com/group/clojurescript. > > -- > 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 from it, send an > email to clojurescript+unsubscr...@googlegroups.com. > To post to this group, send email t
Re: [ClojureScript] Javascript arrays
see http://keminglabs.com/blog/angular-cljs-weather-app/ for an example of how to extend ILookup to js objects. On Tuesday, April 8, 2014 7:27:56 AM UTC-4, Gary Trakhman wrote: > you can use aget, get requires ILookup. > > > > On Tue, Apr 8, 2014 at 2:42 AM, Yehonathan Sharvit wrote: > > > > Also, in Clojure on the JVM get works with Java Maps, while in Clojurescript > get doesn’t work with js object. > > > Is there a reason for that? > > > > > > > On Mon, Apr 7, 2014 at 11:00 PM, Yehonathan Sharvit wrote: > > > > > > What about js typed arrays? > > > > Why (array? (js/Float32Array. 3)) is false. > > > > > > > (IndexedSeq. (js/Float32Array. 3) 0) seems to work fine. > > > > > > Will it be safe to modify array? so that it returns true for js typed arrays? > > > > > > > > > > > > > > > > > > > > > On Mon, Apr 7, 2014 at 7:09 PM, David Nolen wrote: > > > > > We will not. The handling of arrays is in correspondence with Clojure on the > JVM. > > > David > > > > > On Mon, Apr 7, 2014 at 12:05 PM, Yehonathan Sharvit wrote: > > > > > > Great! > > > > Will you consider doing the same with javascript objects? > > > > > On Monday, 7 April 2014 00:05:32 UTC+3, David Nolen wrote: > > > Yes JavaScript arrays work with all of the sequence functions. > > > > > > > > > David > > > > > > > > > > > > > On Sun, Apr 6, 2014 at 3:11 PM, Yehonathan Sharvit wrote: > > > > > > I was surprised when I discovered that the following code worked: > > > > > > > > > > > > (some #{2} (clj->js [1 2])) > > > > > > (count (clj->js [1 2])) > > > > > > > > > > > > My question is: Could javascript arrays be safely passed to core functions > > that received a vector? > > > > > > > > > > > > -- > > > > > > 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 from it, send an > > email to clojurescrip...@googlegroups.com. > > > > > > To post to this group, send email to clojur...@googlegroups.com. > > > > > > > > > Visit this group at http://groups.google.com/group/clojurescript. > > > > -- > > 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 from it, send an > email to clojurescrip...@googlegroups.com. > > > > To post to this group, send email to clojur...@googlegroups.com. > > Visit this group at http://groups.google.com/group/clojurescript. > > > > > > > > > > -- > > Note that posts from new members are moderated - please be patient with your > first post. > > --- > > You received this message because you are subscribed to a topic in the Google > Groups "ClojureScript" group. > > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/clojurescript/R3O2aKXpsEY/unsubscribe. > > To unsubscribe from this group and all its topics, send an email to > clojurescrip...@googlegroups.com. > > To post to this group, send email to clojur...@googlegroups.com. > > Visit this group at http://groups.google.com/group/clojurescript. > > > > > > -- > > > "Are we what we become or do we become what we are?" - Prof. Beno Gross > > > > > > > > > -- > > > "Are we what we become or do we become what we are?" - Prof. Beno Gross > > > > > > > -- > > 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 from it, send an > email to clojurescrip...@googlegroups.com. > > To post to this group, send email to clojur...@googlegroups.com. > > Visit this group at http://groups.google.com/group/clojurescript. -- 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 from it, send an email to clojurescript+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
[ClojureScript] Re: Ran tests with v20140417
Would you mind seeing if http://dev.clojure.org/jira/browse/CLJS-790 is resolved by this version of the compiler? On Tuesday, April 8, 2014 8:15:05 AM UTC-5, Tim Visher wrote: > Hi All, > > > > v20140417 was just released to Maven Central. > > > > With the following patch: > > > > diff --git a/project.clj b/project.clj > > index d80ceef..0afea52 100644 > > --- a/project.clj > > +++ b/project.clj > > @@ -12,7 +12,7 @@ > > [org.clojure/data.json "0.2.3"] > > [org.clojure/tools.reader "0.8.3"] > > [org.clojure/google-closure-library > > "0.0-20130212-95c19e7f0f5f"] > > - [com.google.javascript/closure-compiler "v20131014"] > > + [com.google.javascript/closure-compiler "v20140407"] > > [org.mozilla/rhino "1.7R4"]] > >:profiles {:1.5 {:dependencies [[org.clojure/clojure "1.5.1"]]} > > :1.6 {:dependencies [[org.clojure/clojure > > "1.6.0-master-SNAPSHOT"]]}} > > > > I ran: > > > > $ V8_HOME=/usr/local/bin SPIDERMONKEY_HOME=/usr/local/bin > > JSC_HOME=/usr/local/bin script/t > > est > > Testing with V8 > > Tests completed without exception > > > > > > Testing with SpiderMonkey > > out/core-advanced-test.js:533: Error: Assert failed: (not (integer? 1e+308)) > > Testing with JavaScriptCore > > Tests completed without exception > > > > > > NASHORN_HOME not set, skipping Nashorn tests > > Tested with 3 out of 4 possible js targets > > > > Just FYI! :) > > > > -- > > > > In Christ, > > > > Timmy V. > > > > http://blog.twonegatives.com/ > > http://five.sentenc.es/ -- Spend less time on mail -- 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 from it, send an email to clojurescript+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
[ClojureScript] Ran tests with v20140417
Hi All, v20140417 was just released to Maven Central. With the following patch: diff --git a/project.clj b/project.clj index d80ceef..0afea52 100644 --- a/project.clj +++ b/project.clj @@ -12,7 +12,7 @@ [org.clojure/data.json "0.2.3"] [org.clojure/tools.reader "0.8.3"] [org.clojure/google-closure-library "0.0-20130212-95c19e7f0f5f"] - [com.google.javascript/closure-compiler "v20131014"] + [com.google.javascript/closure-compiler "v20140407"] [org.mozilla/rhino "1.7R4"]] :profiles {:1.5 {:dependencies [[org.clojure/clojure "1.5.1"]]} :1.6 {:dependencies [[org.clojure/clojure "1.6.0-master-SNAPSHOT"]]}} I ran: $ V8_HOME=/usr/local/bin SPIDERMONKEY_HOME=/usr/local/bin JSC_HOME=/usr/local/bin script/t est Testing with V8 Tests completed without exception Testing with SpiderMonkey out/core-advanced-test.js:533: Error: Assert failed: (not (integer? 1e+308)) Testing with JavaScriptCore Tests completed without exception NASHORN_HOME not set, skipping Nashorn tests Tested with 3 out of 4 possible js targets Just FYI! :) -- In Christ, Timmy V. http://blog.twonegatives.com/ http://five.sentenc.es/ -- Spend less time on mail -- 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 from it, send an email to clojurescript+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
Re: [ClojureScript] Javascript arrays
you can use aget, get requires ILookup. On Tue, Apr 8, 2014 at 2:42 AM, Yehonathan Sharvit wrote: > Also, in Clojure on the JVM get works with Java Maps, while in > Clojurescript get doesn't work with js object. > Is there a reason for that? > > > On Mon, Apr 7, 2014 at 11:00 PM, Yehonathan Sharvit wrote: > >> What about js *typed arrays*? >> >> Why *(array? (js/Float32Array. 3))* is false. >> >> *(IndexedSeq. (js/Float32Array. 3) 0)* seems to work fine. >> >> Will it be safe to modify array? so that it returns true for js typed >> arrays? >> >> >> >> >> >> >> >> On Mon, Apr 7, 2014 at 7:09 PM, David Nolen wrote: >> >>> We will not. The handling of arrays is in correspondence with Clojure on >>> the JVM. >>> >>> David >>> >>> >>> On Mon, Apr 7, 2014 at 12:05 PM, Yehonathan Sharvit wrote: >>> Great! Will you consider doing the same with javascript objects? On Monday, 7 April 2014 00:05:32 UTC+3, David Nolen wrote: > Yes JavaScript arrays work with all of the sequence functions. > > > David > > > > On Sun, Apr 6, 2014 at 3:11 PM, Yehonathan Sharvit wrote: > > I was surprised when I discovered that the following code worked: > > > > (some #{2} (clj->js [1 2])) > > (count (clj->js [1 2])) > > > > My question is: Could javascript arrays be safely passed to core functions that received a vector? > > > > -- > > 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 from it, send an email to clojurescrip...@googlegroups.com. > > To post to this group, send email to clojur...@googlegroups.com. > > Visit this group at http://groups.google.com/group/clojurescript. -- 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 from it, send an email to clojurescript+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript. >>> >>> -- >>> Note that posts from new members are moderated - please be patient with >>> your first post. >>> --- >>> You received this message because you are subscribed to a topic in the >>> Google Groups "ClojureScript" group. >>> To unsubscribe from this topic, visit >>> https://groups.google.com/d/topic/clojurescript/R3O2aKXpsEY/unsubscribe. >>> To unsubscribe from this group and all its topics, send an email to >>> clojurescript+unsubscr...@googlegroups.com. >>> To post to this group, send email to clojurescript@googlegroups.com. >>> Visit this group at http://groups.google.com/group/clojurescript. >>> >> >> >> >> -- >> "Are we what we become or do we become what we are?" - Prof. Beno Gross >> > > > > -- > "Are we what we become or do we become what we are?" - Prof. Beno Gross > > -- > 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 from it, send an > email to clojurescript+unsubscr...@googlegroups.com. > To post to this group, send email to clojurescript@googlegroups.com. > Visit this group at http://groups.google.com/group/clojurescript. > -- 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 from it, send an email to clojurescript+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.
[ClojureScript] Export properties and methods?
I'm using deftype and the Object protocol to create objects with properties and methods that are natural to use from JS client code. But I can't get this to work with advanced optimizations enabled, it seems that only functions can be exported with the ^:export tag. Is this true? It seems like it would be possible to export the methods and properties using the closure exportProperty and exportSymbol functions and I could write a macro to do this automatically, but I just want to make sure that an existing solution does not already exist. Thanks for any help, Brent Shields -- 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 from it, send an email to clojurescript+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript.