tag:blogger.com,1999:blog-35275067.post8796578304201388987..comments2011-07-18T18:05:29.630-05:00Comments on /dev/rohner: Writing JQuery code with ScriptjureAllen Rohnerhttp://www.blogger.com/profile/14551766042595741221noreply@blogger.comBlogger11125tag:blogger.com,1999:blog-35275067.post-12050770170979254632011-07-18T18:05:29.630-05:002011-07-18T18:05:29.630-05:00Actually, I was still unable to get that to work. ...Actually, I was still unable to get that to work. I'm pretty sure anytime you access an attribute of something, it's automatically considered as a function.<br /><br />I did write a macro to simplify some annoying ajax crap <a href="http://pastebin.com/nhkLyLUx" rel="nofollow">here</a>.<br />You can use it like this:<br />(js (access "/url/$0/$1/$2/" param0 param1 param3))<br /><br />Clojure & scriptjure kicks ass! I used to write ~10 lines of code for some of that ajax stuff and now I write one!Sean Neilanhttps://www.blogger.com/profile/16544458518355031891noreply@blogger.comtag:blogger.com,1999:blog-35275067.post-32856936302811089822011-07-18T09:48:00.253-05:002011-07-18T09:48:00.253-05:00Sean, (.id ($ "#foo")), or (. ($ "#...Sean, (.id ($ "#foo")), or (. ($ "#foo") id)Allen Rohnerhttps://www.blogger.com/profile/14551766042595741221noreply@blogger.comtag:blogger.com,1999:blog-35275067.post-17412712997557464592011-07-17T14:47:59.841-05:002011-07-17T14:47:59.841-05:00Sorry it took me so long to respond. I forgot to s...Sorry it took me so long to respond. I forgot to subscribe to the feed.Sean Neilanhttps://www.blogger.com/profile/16544458518355031891noreply@blogger.comtag:blogger.com,1999:blog-35275067.post-29296058613434702422011-07-17T14:44:42.670-05:002011-07-17T14:44:42.670-05:00Cool! I'm using it on this project at work at ...Cool! I'm using it on this project at work at the moment and it's definitely working pretty well. I definitely need to add something to access an attribute like .id<br /><br />I like it a lot better than coffeescript and it compiles to javascript anyway so nobody worries about it.<br /><br />For example<br />Right now, to write something like $("#foo").id, I need to write (quote "$('#foo').id"). I can't write something like (get ($ "#foo") id) because it becomes<br />get($("#foo"),id);<br /><br />Once I have time, I plan to write a program to input javascript or coffeescript into clojure. Maybe even make something to import/export python and import css/sass. That way web development can be in one language.Sean Neilanhttps://www.blogger.com/profile/16544458518355031891noreply@blogger.comtag:blogger.com,1999:blog-35275067.post-37031023724673799492011-07-15T10:23:07.579-05:002011-07-15T10:23:07.579-05:00Sean, 1) Scriptjure works, clojurescript was a pro...Sean, 1) Scriptjure works, clojurescript was a prototype that never got off the ground. 2) Clojurescript is an attempt to port all of Clojure to javascript. Scriptjure is a small DSL intended for writing javascript in clojure. Scriptjure is much simpler, and produces somewhat readable code.Allen Rohnerhttps://www.blogger.com/profile/14551766042595741221noreply@blogger.comtag:blogger.com,1999:blog-35275067.post-78642359215656206032011-07-15T01:39:09.485-05:002011-07-15T01:39:09.485-05:00How is this any different from ClojureScript?
http...How is this any different from ClojureScript?<br />https://github.com/richhickey/clojure-contrib/tree/master/clojurescriptSean Neilanhttps://www.blogger.com/profile/16544458518355031891noreply@blogger.comtag:blogger.com,1999:blog-35275067.post-30440278907389965202011-02-17T10:58:47.771-06:002011-02-17T10:58:47.771-06:00Great post. That's very helpful. This example ...Great post. That's very helpful. This example shows composition of single functions. I've been getting stuck when I try to expand this example to multiple statements inside of the on-ready function, and multiple javascript functions inside the script tag, below the on-ready. Do you think you could show an example of this kind of more elaborate function composition using similar clojure techniques?Kerry Todyruikhttps://www.blogger.com/profile/11351502787894313375noreply@blogger.comtag:blogger.com,1999:blog-35275067.post-82708296386904948152010-04-15T10:38:49.106-05:002010-04-15T10:38:49.106-05:00Alex: I've added a clojure label to a few post...Alex: I've added a clojure label to a few posts. Thanks!Allen Rohnerhttps://www.blogger.com/profile/14551766042595741221noreply@blogger.comtag:blogger.com,1999:blog-35275067.post-59549938428835864812010-04-15T10:07:10.581-05:002010-04-15T10:07:10.581-05:00One fun, not probably practical, option would be w...One fun, not probably practical, option would be write Clojurescript, a Clojure interpreter in Javascript. <br /><br />Similarly what I did for Factor: http://huttuh.blogspot.com/2010/04/factorscript-jquery-and-factor-proof-of.htmlHenrik Huttunenhttps://www.blogger.com/profile/01845345214435219727noreply@blogger.comtag:blogger.com,1999:blog-35275067.post-18115425939514440592010-04-15T03:18:56.197-05:002010-04-15T03:18:56.197-05:00Very nice. This approach will remove a lot of repe...Very nice. This approach will remove a lot of repetition from my code.maaclhttps://www.blogger.com/profile/03957062577673090902noreply@blogger.comtag:blogger.com,1999:blog-35275067.post-84769987563941659422010-04-15T01:43:59.537-05:002010-04-15T01:43:59.537-05:00It looks interesting. If you'll add clojure l...It looks interesting. If you'll add clojure label to your Clojure-related posts, I can add your blog into Planet Clojure - your posts could be useful for many peoplesAlex Otthttps://www.blogger.com/profile/13001951608173211050noreply@blogger.com