Re: better community docs: getting started

2011-07-25 Thread Sean Corfield
On Sun, Jul 24, 2011 at 9:14 PM, Ken Wesson kwess...@gmail.com wrote: Under 2) would be a guide for setting up Emacs (immediately divided into Mac, Windows, Linux).  At the end would be a list of alternative options: Eclipse, Netbeans, IntelliJ, etc. No. No, no, no, no, no! That will kill

Re: clojure.contrib.profile crashes

2011-07-25 Thread Sunil S Nandihalli
Hi Aaron Bedra, Thanks for your quick response. Sorry I could not get back to you with the information you asked for sooner.. I am using user *clojure-version* {:major 1, :minor 2, :incremental 1, :qualifier } My project.clj is as follows... (defproject bitvector 1.0.0-SNAPSHOT

Re: clojure.contrib.profile crashes

2011-07-25 Thread Sunil S Nandihalli
here is the list of jar files in my lib directory github@eagle ~/bitvector/lib#tree . |-- clj-iterate-0.95-20110417.030036-2.jar |-- clojure-1.2.1.jar |-- clojure-contrib-1.2.0.jar `-- dev |-- cdt-1.2.6.1-20110417.030036-6.jar |-- clojure-1.2.1.jar |-- clojure-contrib-1.2.0.jar

Re: Clojure number crunching win ! was Re: Needing type hinting help for number crunching

2011-07-25 Thread Tassilo Horn
Sean Corfield seancorfi...@gmail.com writes: Hi Sean, If you specify the Sonatype snapshots repository, you can pull nightly builds: :repositories { sonatype { :url https://oss.sonatype.org/content/repositories/snapshots; } } :dependencies [[org.clojure/clojure 1.3.0-master-SNAPSHOT]]

Re: better community docs: getting started

2011-07-25 Thread pmbauer
I do not think we should attempt a recommended IDE (not even Clooj). We should offer a path for all existing IDEs / editors. ... Use an editor not listed here? Try Clooj (i.e., use this as a simple catch-all if we haven't covered what you already used today). That's one way of

Re: Why is this code so slow?

2011-07-25 Thread Oskar
On Jul 23, 4:06 pm, Dmitry Gutov raa...@gmail.com wrote: Ahem. Here is a more idiomatic version that runs under half a second, no annotations required. I did that from the beginning, but as I really needed 4e6 and not 1e5 elements, that map got very big. And I didn't remember the argument to

Re: better community docs: getting started

2011-07-25 Thread Ken Wesson
On Mon, Jul 25, 2011 at 12:28 AM, pmbauer paul.michael.ba...@gmail.com wrote: +1 on clooj. One click and you have a working build environment, REPL, and REPL-aware editor. https://github.com/downloads/arthuredelstein/clooj/clooj-0.1.5-standalone.jar This URL is somewhat unfortunate. For some

Re: better community docs: getting started

2011-07-25 Thread Ambrose Bonnaire-Sergeant
Yep, Github URLs suck like that. FWIW this is probably close what you're looking for: https://github.com/arthuredelstein/clooj/downloads Ambrose -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: better community docs: getting started

2011-07-25 Thread cljneo
ClojureScript release has changed things now and I guess that getting started with ClojureScript will probably change as it gets closer to a release. But anyway, I suggest a getting started page along these lines: * *Meet Clojure* - Try Clojure online http://try-clojure.org/ or on your

Re: better community docs: getting started

2011-07-25 Thread Mark Derricutt
I just thought - Java Webstart based clooj direct from try-clojure.org. Mark On 25/07/2011, at 6:51 PM, pmbauer wrote: For usability, nothing beats the single-click. In seconds, Clooj gives her a one-stop-shop. So I see Clooj as something worth putting right along with try-clojure.org. It

Re: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread Mark Derricutt
Oracle announced/talked about Nashorn at the recent JVM Languages summit, this is an Invoke Dynamic based Javascript runtime which is (aiming) for inclusion in JDK8. I do so hope however that someone manages to pull that out for a lets run this NOW on Java 7 as that would be a great

Re: better community docs: getting started

2011-07-25 Thread Sean Corfield
On Sun, Jul 24, 2011 at 11:51 PM, pmbauer paul.michael.ba...@gmail.com wrote: But think of the casual dev wanting to know what Clojure and a typical Clojure toolchain can do for her ASAP. I find it hard to imagine a casual dev that doesn't already have a preferred editor - but I'm certainly not

Re: Clojure number crunching win ! was Re: Needing type hinting help for number crunching

2011-07-25 Thread Sean Corfield
On Sun, Jul 24, 2011 at 11:45 PM, Tassilo Horn tass...@member.fsf.org wrote: The only issue is that with the repo above, version ranges don't work.  If I say  :dependencies [[org.clojure/clojure [1.3.0-master-SNAPSHOT,)]] Your Maven-fu is far off the scale - I didn't even know that kind of

Re: better community docs: getting started

2011-07-25 Thread Mark Derricutt
I just thought - Java Webstart based clooj direct from try-clojure.org. On 25/07/2011, at 6:51 PM, pmbauer wrote: For usability, nothing beats the single-click. In seconds, Clooj gives her a one-stop-shop. So I see Clooj as something worth putting right along with try-clojure.org. It not

Re: clojurescript development workflow

2011-07-25 Thread Sam Aaron
On 24 Jul 2011, at 23:10, Eric Lavigne wrote: Also, look for a recent post by Peter Taoussanis. It sounds like he has come up with a very good workflow for ClojureScript development. That certainly looks very interesting and exactly the kind of thing I was looking for. Also, with respect

Re: better community docs: getting started

2011-07-25 Thread Michael Wood
On 25 July 2011 09:41, Sean Corfield seancorfi...@gmail.com wrote: On Sun, Jul 24, 2011 at 11:51 PM, pmbauer paul.michael.ba...@gmail.com wrote: [...] That's why I would give Clooj some prominence rather than burying it at the bottom of the decision tree. Well, then put it at the top with

Re: better community docs: getting started

2011-07-25 Thread abp
* *Meet Clojure* That's also an upcoming book on Clojure: http://meetclj.raynes.me/ -- 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

Re: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread Colin Yates
Absolutely nothing to add to the argument as such except to say that I am quite surprised at the level of resistance to James' thread. I can see the argument if this was the 'dev' mailing list. I have been reading this mailing list for a long while now (even if I haven't contributed much to it)

Re: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread Ken Wesson
On Mon, Jul 25, 2011 at 5:08 AM, Colin Yates colin.ya...@gmail.com wrote: Absolutely nothing to add to the argument as such except to say that I am quite surprised at the level of resistance to James' thread.  I can see the argument if this was the 'dev' mailing list. I have been reading this

Re: Why is this code so slow?

2011-07-25 Thread Dmitry Gutov
Clojure 1.2.1 here. 4e6 takes about 10 seconds, the process uses ~500Mb of RAM. `lein repl` is fine with that. Python takes 5, but that's acceptable difference, I think, considering we're talking immutable vs mutable here. If you still have the old code, I'd like to take a look. On Jul 25,

Re: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread cassiel
Clojure newcomer here, but here's the thought that's frontmost in my mind about ClojureScript... I'm used to Clojure as a language that's solidly spot-welded to the JVM and the Java libraries. Just as [1 2 3] is legal portable Clojure code, so is (.start (Thread. #(...))) despite it being a

Re: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread James Keats
Right, Rich, please allow me to reply to the points you mentioned; I declined from doing so last night as I sensed some unintentionally irritated feelings, which I hope have eased a bit by now. I believe all my posts in this discussion are purely technical concerns and I believe them to be

Re: ClojureScript Questions

2011-07-25 Thread Nick Zbinden
On Jul 25, 7:51 am, cljneo cljneoph...@gmail.com wrote: Hi, I have started reading about ClojureScript and Closure and had some questions which I am sure will eventually be answered as I move along. But I am too eager to know now so I thought of asking instead of waiting. - On page 2 of

Re: Clojure number crunching win ! was Re: Needing type hinting help for number crunching

2011-07-25 Thread Chas Emerick
On Jul 24, 2011, at 4:30 PM, Sean Corfield wrote: On Sun, Jul 24, 2011 at 1:11 PM, bernardH un.compte.pour.tes...@gmail.com wrote: On Jul 24, 2:30 pm, Chas Emerick cemer...@snowtide.com wrote: You should be using 1.3.0-beta1 of Clojure 1.3 -- anything with -master-SNAPSHOT is woefully out

Re: Clojure number crunching win ! was Re: Needing type hinting help for number crunching

2011-07-25 Thread Chas Emerick
On Jul 25, 2011, at 3:47 AM, Sean Corfield wrote: On Sun, Jul 24, 2011 at 11:45 PM, Tassilo Horn tass...@member.fsf.org wrote: The only issue is that with the repo above, version ranges don't work. If I say :dependencies [[org.clojure/clojure [1.3.0-master-SNAPSHOT,)]] Your Maven-fu

Re: casting and type declaration

2011-07-25 Thread Dmitry Gutov
Type annotations are used at compile time to generate direct method calls (as opposed to using reflection). `cast` is a function, so it doesn't do anything until runtime, and it just delegates to Class#cast. I don't think it is used much. In the core, it's only called in single- arity cases for *

Re: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread Alen Ribic
In the middle of what? I look at ClojureScript code and it looks like Clojure to me. Google Closure is under, and it is no more annoying there than Java is under Clojure - an implementation detail, and a rich source of production-quality code. I respectfully dispute that; for what they

JavaScript is Assembly Language for the Web

2011-07-25 Thread Jimmy
With clojurescript just launched, I thought there might be some interest in this podcast by Scott Hanselman. JavaScript is Assembly Language for the Web - http://www.hanselminutes.com/default.aspx?showID=294 Some discussion regarding the podcast.

Re: better community docs: getting started

2011-07-25 Thread Mark Derricutt
I just thought - Java Webstart based clooj direct from try-clojure.org. On 25/07/2011, at 6:51 PM, pmbauer wrote: For usability, nothing beats the single-click. In seconds, Clooj gives her a one-stop-shop. So I see Clooj as something worth putting right along with try-clojure.org. It not

Re: clojurescript development workflow

2011-07-25 Thread Eric Lavigne
Also, with respect to the lack of ability to interact with the browser directly through the REPL or editor like with emacs-swank-slime, is it fair to assume that this is just due to the current implementation being Rhino-based? Also ClojureScript doesn't support eval, I'm assuming

Re: Clojure number crunching win ! was Re: Needing type hinting help for number crunching

2011-07-25 Thread Tassilo Horn
Sean Corfield seancorfi...@gmail.com writes: Hi Sean, On Sun, Jul 24, 2011 at 11:45 PM, Tassilo Horn tass...@member.fsf.org wrote: The only issue is that with the repo above, version ranges don't work.  If I say  :dependencies [[org.clojure/clojure [1.3.0-master-SNAPSHOT,)]] Your Maven-fu

Re: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread Nick Zbinden
Oracle announced/talked about Nashorn at the recent JVM Languages summit, this is an Invoke Dynamic based Javascript runtime which is (aiming) for inclusion in JDK8. I do so hope however that someone manages to pull that out for a lets run this NOW on Java 7 as that would be a great

Re: clojurescript development workflow

2011-07-25 Thread Scott Jaderholm
On Mon, Jul 25, 2011 at 4:02 AM, Sam Aaron samaa...@gmail.com wrote: Also, with respect to the lack of ability to interact with the browser directly through the REPL or editor like with emacs-swank-slime, is it fair to assume that this is just due to the current implementation being

Re: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread Mark Rathwell
Colin, I don't think anyone responding was doing so with the mindset of my way or the highway and we must defend the great leader's achievements. Speaking for myself, I responded to an argument that did not make sense, that argument being basically: Crockford says javascript can be written a

Re: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread Lars Rune Nøstdal
I'd say Google Closure/Libray is more idiomatic JavaScript than jQuery; jQuery is more sugary and has a different feel to it. I like jQuery, but I completely see why that is not a the most optimal base to build on when something like Google Closure exists. Rich mentioned, however, that people

Re: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread Ken Wesson
On Mon, Jul 25, 2011 at 8:28 AM, Mark Rathwell mark.rathw...@gmail.com wrote: Colin, I don't think anyone responding was doing so with the mindset of my way or the highway and we must defend the great leader's achievements.  Speaking for myself, I responded to an argument that did not make

Re: [ANN] ClojureScript

2011-07-25 Thread Andreas Liljeqvist
There is some small mentions about mobile around Clojurescript. What is the plan for Mobile integration? Why wouldn't Clojure be a better fit on the androidplatform? (performance and build problems aside) -- You received this message because you are subscribed to the Google Groups Clojure group.

Re: JavaScript is Assembly Language for the Web

2011-07-25 Thread Frank Gerhardt
Yes. And somebody said that Java is the assembly language of the JVM. So true. Frank. On Mon, Jul 25, 2011 at 11:56 AM, Jimmy jimmy.co...@gmail.com wrote: With clojurescript just launched, I thought there might be some interest in this podcast by Scott Hanselman. JavaScript is Assembly

Re: better community docs: getting started

2011-07-25 Thread Lee Spector
On Jul 25, 2011, at 4:11 AM, Michael Wood wrote: On 25 July 2011 09:41, Sean Corfield seancorfi...@gmail.com wrote: On Sun, Jul 24, 2011 at 11:51 PM, pmbauer paul.michael.ba...@gmail.com wrote: [...] That's why I would give Clooj some prominence rather than burying it at the bottom of the

Re: JavaScript is Assembly Language for the Web

2011-07-25 Thread Lars Heidieker
Except for the fact that it is categorically wrong, it's some intuition behind the statement that might be valid. On Mon, Jul 25, 2011 at 3:05 PM, Frank Gerhardt f...@gerhardtinformatics.com wrote: Yes. And somebody said that Java is the assembly language of the JVM. So true. Frank. On Mon,

Re: ClojureScript

2011-07-25 Thread Sam Aaron
Hi Peter, I would also love to know how you set this up in a little more detail. It really sounds like an excellent approach… Sam --- http://sam.aaron.name On 25 Jul 2011, at 05:46, FL wrote: On Jul 24, 1:44 pm, Peter Taoussanis ptaoussa...@gmail.com wrote: ... I am, literally,

Re: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread Steve
On Jul 25, 7:54 pm, James Keats james.w.ke...@gmail.com wrote: Best regards; love you, man, and sorry again for any misunderstanding or unintended miscommunication. My humble suggestion is when you find yourself in your 5th or 6th paragraph of an opinion piece there's a reasonable chance what

Re: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread Colin Yates
+1 - I think an etiquette document needs to be written. On 25 July 2011 15:10, Steve stephen.a.lind...@gmail.com wrote: On Jul 25, 7:54 pm, James Keats james.w.ke...@gmail.com wrote: Best regards; love you, man, and sorry again for any misunderstanding or unintended miscommunication.

Re: clojure.contrib.profile crashes

2011-07-25 Thread Colin Jones
This could be the same issue that Kevin Baribeau has found with clojure.contrib.profile here: https://github.com/richhickey/clojure-contrib/pull/2#issuecomment-1385392 (Yes, we know he needs a CA, etc. - he mentions requesting assembla access before closing that pull request.) TL;DR - might

Re: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread Brenton
James, The reason you are experiencing resistance is because you are proposing changes to things that will never change. Rich came up with the Rationale before designing ClojureScript and long before writing any code. All of the design work was informed by this. You are arguing that there should

ClojureScript on Windows

2011-07-25 Thread Timothy Baldridge
Is there a documented way to get ClojureScript working on Windows? While I'm familiar with Linux, and use it in several server environments, all my development is on Windows, so I don't really have access to a Linux box for development. Timothy -- “One of the main causes of the fall of the

Re: ClojureScript on Windows

2011-07-25 Thread Tamreen Khan
I've gotten the basics working. Haven't had the time to write up a full blog post, though. Basically I used Cygwin so that I could run the bootstrap script. In any of the shell scripts where it sets a classpath you'll have to change the colons to semicolons. On Mon, Jul 25, 2011 at 10:59 AM,

Re: ClojureScript on Windows

2011-07-25 Thread Mark Rathwell
Also, VirtualBox (http://www.virtualbox.org/) is free, if you were interested in linux for some development. On Mon, Jul 25, 2011 at 11:06 AM, Tamreen Khan histor...@gmail.com wrote: I've gotten the basics working. Haven't had the time to write up a full blog post, though. Basically I used

Re: JavaScript is Assembly Language for the Web

2011-07-25 Thread Luc Prefontaine
From an historic perspective it's absolutely right. It happened in the past already. When you end up writing thousands of lines of code to achieve what should be a simple objective and you need assistance from sophisticated tools to get the task done, it means that the language used is at a very

Re: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread Chouser
On Sun, Jul 24, 2011 at 11:19 AM, James Keats james.w.ke...@gmail.com wrote: Google Closure is too Java. It's not idiomatic JavaScript. I find it disappointing that rather than porting from a functional language like Clojure straight to another functional language like Javascript, the google

Re: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread Timothy Baldridge
So, you could use ClojureScript and jQuery to write a snappy little demo and prove to everyone the value of that approach. I'm sure I'm not the only one that would be interested in seeing such a demo. I think Rich's point in his talk is good to re-iterate here. Is jQuery cool? Yes! I would

Re: ClojureScript Questions

2011-07-25 Thread Jack Moffitt
- On page 2 of the Closure book, there is a workflow figure on using the Closure tools, how would ClojureScript change this workflow? It would be great to post such a modified diagram to the closure wiki. Some quick notes on this: 1) calcdeps.py and the compiler are taken care of for you by

Re: better community docs: getting started

2011-07-25 Thread nchurch
How about making the main suggestion be clooj instead, with emacs, eclipse, netbeans in the list of alternative options? :) Sounds like consensus around Clooj. Released on July 18th, top option on July 25th! Things move at lightspeed around here The one thing I want to say about Emacs is

Re: ClojureScript

2011-07-25 Thread Ghadi Shayban
It will be a only a matter of time before people realize it doesn't matter whether jQuery integrates or not. The examples/blog posts coming out already are spectacular. On Jul 24, 1:44 pm, Peter Taoussanis ptaoussa...@gmail.com wrote: Just want to throw in on this real quick. I am -dumbfounded-

Re: Clojure number crunching win ! was Re: Needing type hinting help for number crunching

2011-07-25 Thread Phil Hagelberg
On Mon, Jul 25, 2011 at 3:10 AM, Chas Emerick cemer...@snowtide.com wrote: (I think the only useful artifacts at build.clojure.org that aren't in central already are old versions of clojure-contrib (1.0.0 and 1.1.0 AFAICT).  Is that what's keeping build.clojure.org/* in Leiningen's default

Re: clojurescript development workflow

2011-07-25 Thread Max Weber
Hi, today I've been working on cljs-devmode: https://github.com/maxweber/cljs-devmode It is a really primitive prototype of a development mode for ClojureScript. For an explanation take a look at the README on the GitHub repo. I'm in a hurry so I'm going to continue the work on cljs- devmode

Re: :require farms in Clojure?

2011-07-25 Thread Laurent PETIT
And then goodbye statical analysis ... :-) 2011/7/20 Meikel Brandmeyer m...@kotka.de Hi, Am Mittwoch, 20. Juli 2011 06:38:27 UTC+2 schrieb Chas Emerick: Try: (ns myfuns (:require (foo.baz [a :as a] [b :as b] [c :as c])) I think he wants more

Re: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread nchurch
+1 to writing an etiquette document. I have to confess I wrote a long post a few weeks ago without realizing these sorts of posts belonged on blogs (it was, oddly enough, another James Keats thread, on the subject of Steve Yegge. I figured if \Yegge writes long blogs). I didn't intend to

Re: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread Jack Moffitt
Rich, the pseudo class model with the new keyword is a syntactic obfuscation, semantically javascript is prototypical inheritance. It's class free. In addition to the pseudo class inheritance advocated by google closure and the prototypical inherent in javascript, others like Doug Crockford

Re: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread Ken Wesson
On Mon, Jul 25, 2011 at 12:59 PM, nchurch nchubr...@gmail.com wrote: +1 to writing an etiquette document.  I have to confess I wrote a long post a few weeks ago without realizing these sorts of posts belonged on blogs Not everyone *has* a blog, you know. Ken was helpful to me then when he

Re: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread pmbauer
Fair point, but Rhino doesn't always have the correct semantics. For example, one common JS idiom for default params: eval(undefined || 2 + 2) = returns true instead of 4 But mostly, Rhino is just a JS engine with no DOM, so is less than ideal for browser UI development. I do so hope

Re: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread nchurch
nchurch, I arrest you, try you, and find you guilty of the heinous charge of top-posting, thou knave, thou scum, thou waster of bandwidth! I confess that I have erred and strayed from thy ways like a lost sheep -- You received this message because you are subscribed to the Google Groups

Re: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread Ken Wesson
On Mon, Jul 25, 2011 at 1:23 PM, nchurch nchubr...@gmail.com wrote: nchurch, I arrest you, try you, and find you guilty of the heinous charge of top-posting, thou knave, thou scum, thou waster of bandwidth! I confess that I have erred and strayed from thy ways like a lost sheep For

Re: :require farms in Clojure?

2011-07-25 Thread Meikel Brandmeyer
Salut Laurent, Am 25.07.2011 um 18:54 schrieb Laurent PETIT: And then goodbye statical analysis ... :-) I didn't say, that I think it's a good idea to do this. :) On the other hand I'm not afraid of dynamic analysis either. That's what VimClojure does at the moment anyway. Static analysis is

Re: clojurescript development workflow

2011-07-25 Thread Sam Aaron
On 25 Jul 2011, at 17:33, Max Weber wrote: Hi, today I've been working on cljs-devmode: https://github.com/maxweber/cljs-devmode It is a really primitive prototype of a development mode for ClojureScript. For an explanation take a look at the README on the GitHub repo. I'm in a hurry

Re: better community docs: getting started

2011-07-25 Thread Sergey Didenko
IMO, it's a very good idea to give much more accent on the easiest options for newcomers. Other than not recommending Emacs, do people think that the overall organization I suggested is a good idea? I should reiterate that other information needs to be accessible; for now I'd just like to see

Parsing double with default value

2011-07-25 Thread siyu798
Hi, Is there an idiomatic/built-in way to parse double with a default value if there's exception? Currently we use a generic with-default macro to ignore exception and return default value as follow: (with-default 0.0 (Double. my-value)) -- You received this message because you are

Re: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread daly
On Mon, 2011-07-25 at 09:59 -0700, nchurch wrote: +1 to writing an etiquette document. In place of an etiquette document I suggest the book called Producing Open Source Software. In this generally useful book there is some advice, mostly directed at project leads but this section is relevant:

Need Help Parsing Clojure Strings

2011-07-25 Thread octopusgrabbus
I have a web application that returns data that is pipe-delimited and looks like this: AT|1 Kenilworth Rd||Soapville|ZA|99901-7505|Option value=A == Normal street matchOption value=T == ZIP+4 corrected|013|C065| What I want to do is take the zip-zip4 field, split the zip and zip 4 apart, and add

Re: Parsing double with default value

2011-07-25 Thread Tassilo Horn
siyu798 siyu...@gmail.com writes: Hi! Is there an idiomatic/built-in way to parse double with a default value if there's exception? Not that I know of. Currently we use a generic with-default macro to ignore exception and return default value as follow: (with-default 0.0 (Double.

Re: Need Help Parsing Clojure Strings

2011-07-25 Thread Islon Scherer
Do you want something like: (vec (.split some-string \\|)) (vec (.split AT|1 Kenilworth Rd||Soapville|ZA|99901-7505|Option value=A == Normal street matchOption value=T == ZIP+4 corrected|013|C065| \\|)) = [AT 1 Kenilworth Rd Soapville ZA 99901-7505 Option value=A == Normal street matchOption

Re: Need Help Parsing Clojure Strings

2011-07-25 Thread Tassilo Horn
octopusgrabbus octopusgrab...@gmail.com writes: Hi! What I want to do is take the zip-zip4 field, split the zip and zip 4 apart, and add them as separate fields right after state ZA. I want to do some other things too (like remove from Option value... through 013), but that's the next step.

Re: Parsing double with default value

2011-07-25 Thread siyu798
Tassilo, The reason a generic default macro being used here is because we can use the same macro to parse other data type like integer: (with-default 1 (Integer. my-value)) Thanks, siyu -- You received this message because you are subscribed to the Google Groups Clojure group. To post to

Re: Parsing double with default value

2011-07-25 Thread Alan Malloy
On Jul 25, 1:18 pm, siyu798 siyu...@gmail.com wrote: Tassilo,    The reason a generic default macro being used here is because we can use the same macro to parse other data type like integer: (with-default 1 (Integer. my-value)) Thanks, siyu You can still do the same with a function:

determining whether state has changed in a thread safe manner

2011-07-25 Thread Sam Aaron
Hi there, I have some state which I'd like to set to some default value, A. I'd then like to update A to a new value A' and then, if (not (= A A')) I'd like to fire off a function - say print to stdout that A has changed. If (= A A') I'd like nothing to happen at all. Additionally, I'd like to

Re: determining whether state has changed in a thread safe manner

2011-07-25 Thread Sam Aaron
On 25 Jul 2011, at 21:45, Sam Aaron wrote: (defn update [] (let [changed? (dosync (let [old-a @a new-a (ref-set a (new-val))] (= old-a new-a)))] (when changed? (changed-fn Clearly I meant (not (= old-a new-a)) :-) Sam

Re: determining whether state has changed in a thread safe manner

2011-07-25 Thread Meikel Brandmeyer
Hi, you want a watch. (def a (atom 0)) (add-watch a ::your-id (fn [_your-id _a old-val new-val] (when (not= old-val new-val) (println New value: new-val (swap! a inc) (reset! a 1) (swap! a inc) Sincerely Meikel -- You received this message because you are subscribed to the Google Groups

Re: Need Help Parsing Clojure Strings

2011-07-25 Thread octopusgrabbus
Thanks. I finally got part of my problem when I changed the regex to #\d\d\d\d\d-\d\d\d\d to match the zip-zip4, and when that disappeared, I realized what was going on. On Jul 25, 3:51 pm, Tassilo Horn tass...@member.fsf.org wrote: octopusgrabbus octopusgrab...@gmail.com writes: Hi! What

Re: Need Help Parsing Clojure Strings

2011-07-25 Thread octopusgrabbus
Thanks for the suggestion. I will try this tomorrow and report back. On Jul 25, 3:46 pm, Islon Scherer islonsche...@gmail.com wrote: Do you want something like: (vec (.split some-string \\|)) (vec (.split AT|1 Kenilworth Rd||Soapville|ZA|99901-7505|Option value=A == Normal street matchOption

Re: determining whether state has changed in a thread safe manner

2011-07-25 Thread Sam Aaron
Hi Meikel, On 25 Jul 2011, at 21:51, Meikel Brandmeyer wrote: you want a watch. (def a (atom 0)) (add-watch a ::your-id (fn [_your-id _a old-val new-val] (when (not= old-val new-val) (println New value: new-val (swap! a inc) (reset! a 1) (swap! a inc) That's cool to know -

ClojureScript Demo

2011-07-25 Thread Asim Jalis
Just saw this neat ClojureScript demo, which can be used as a starting point to create a Javascript game. http://jng.imagine27.com/articles/2011-07-23-101007_clojurescript_demo_convex_hull.html -- You received this message because you are subscribed to the Google Groups Clojure group. To post

Re: determining whether state has changed in a thread safe manner

2011-07-25 Thread Meikel Brandmeyer
Hi, Am 25.07.2011 um 23:12 schrieb Sam Aaron: So what if I would like #'update to return a boolean representing whether the state has changed rather than call #'changed-fn internally? (which is actually what i'm trying to do, I just refactored the example to be a lot simpler and hopefully

Re: determining whether state has changed in a thread safe manner

2011-07-25 Thread Sam Aaron
Hi Meikel, On 25 Jul 2011, at 22:46, Meikel Brandmeyer wrote: Am 25.07.2011 um 23:12 schrieb Sam Aaron: Since this is callback based, you can't return a value. Do you want more something like a polling solution? Then you'll have to roll your own with an atom and a

Re: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread James Keats
Perhaps I should've just looked for a blog about knitting or cupcakes and posted what I did here about clojure/clojurescript in it. That way you fine folks won't get to read it, eventhough no one here is obliged in any way to read my posts or any in this thread. Yeah, definitely, that way I

Re: Parsing double with default value

2011-07-25 Thread siyu798
Alan, Your with-default fn is neat. So it appears there's no idiomatic/built-in clojure fn/macro to do parsing and wrapper functions such as follow would be needed to avoid typing the whole expression every time. (def parse-double (with-default #(Double. %) 0.0)) (def parse-int

Re: Parsing double with default value

2011-07-25 Thread Michael
Tassilo and Alan, Thanks for responding. We're new to clj and don't have a good feel of when to you use macros over functions. (defmacro with-dflt Runs body in a try/catch returning result of body if no exception otherwise default [default body] `(try (do ~@body) (catch

Re: better community docs: getting started

2011-07-25 Thread Sean Corfield
On Mon, Jul 25, 2011 at 9:03 AM, nchurch nchubr...@gmail.com wrote: Other than not recommending Emacs, do people think that the overall organization I suggested is a good idea? Yes. for now I'd just like to see us not presenting people with twelve options as their first view of Getting

Re: determining whether state has changed in a thread safe manner

2011-07-25 Thread cassiel
Hi Sam, A nice late night exercise... Not very practical, but if you want a safe transaction-free operation on an atom which returns whether it was changed, you can perhaps hack it by embedding the change state into the atom itself: (def a (atom {:value 45 :changed? false})) (defn

Re: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread Mark Rathwell
James, If I've misread and/or mischaracterized your intentions, I do apologize for that. I was, and still am, unsure as to your desired outcome from this post. If the intent was for the core team to rewrite ClojureScript to target jQuery instead of GClosure, we both know that was not going to

Re: determining whether state has changed in a thread safe manner

2011-07-25 Thread cassiel
Of course, once posted, I realised the conditional could be eliminated: (defn update-and-check-whether-modified? [update-fn] (:changed? (swap! a (fn [{v :value _ :changed?}] (let [new-v (update-fn v)] {:value new-v :changed? (not= v new-v)}) -- You

Re: :require farms in Clojure?

2011-07-25 Thread Laurent PETIT
2011/7/25 Meikel Brandmeyer m...@kotka.de Salut Laurent, Am 25.07.2011 um 18:54 schrieb Laurent PETIT: And then goodbye statical analysis ... :-) I didn't say, that I think it's a good idea to do this. :) On the other hand I'm not afraid of dynamic analysis either. That's what

Re: ClojureScript on Windows

2011-07-25 Thread Laurent PETIT
Taking a look at the content of some of these scripts, I would not be surprised if a lein plugin, and probably also a maven archetype, would come up rapidly (if not already under my radar !) Cheers, -- Laurent 2011/7/25 Timothy Baldridge tbaldri...@gmail.com Is there a documented way to get

Re: clooj, a lightweight IDE for clojure

2011-07-25 Thread Laurent PETIT
Hi, I'm just back after some vacations without Internet connections. Please give me a couple more days to emerge from the tons of emails and workload, and I'll gladly help you in any possible ways. Cheers, -- Laurent 2011/7/18 Arthur Edelstein arthuredelst...@gmail.com On Jul 18, 2:31 am,

Re: [ANN] ClojureScript

2011-07-25 Thread Hoornet
Anyone successfully stated this thing on windows yet? I tried in no avail ... -- 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

Re: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread Christian Marks
On Jul 25, 6:11 pm, James Keats james.w.ke...@gmail.com wrote: I ask, what is it that I did other than seriously inquire about the rationale?! You started a thread with the non-serious title, Alright, fess up, whose unhappy with clojurescript? instead of the more serious Comments on the

Re: Problem with ClojureScript and Node.js

2011-07-25 Thread Oliver Kaiser
I also experience this problem; switching nodejs versions (0.4.11-pre == v0.4 branch, 0.4.10 and 0.5.2) did not have any effect. When compiling with: bin/cljsc samples/nodehello.cljs '{:target :nodejs :optimizations :simple :pretty-print true}' nodehello.js the (first) relevant line for this

Re: Leiningen on OpenBSD

2011-07-25 Thread scitesy
I'm going to listen to Aaron's initial advice and follow the path of least resistance by switching from OpenBSD to Linux (Arch) for Clojure development. Thanks all for your help. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group,

Re: ClojureScript

2011-07-25 Thread Peter Taoussanis
I would also love to know how you set this up in a little more detail. It really sounds like an excellent approach… Sure: it's not complicated! I'm writing this in a hurry though- so hope it's still clear. Basically I just define a memoized dynamic scripts function that returns a map with a

Calling clojure from java.

2011-07-25 Thread mmwaikar
Hi, I am using the Lobos library - https://github.com/budu/lobos In it there's a function create, which is called like this - (create db (table :some-name)), where db is earlier defined as - (def db {:classname org.postgresql.Driver :subprotocol postgresql :user postgres