Re: Why does re-matcher return a mutable object?

2012-11-14 Thread Jon Degenhardt
Luc, Andy, Thanks for the replies. Very helpful, and makes sense. One aspect I'm trying get better insight into are common design patterns for dealing with state (program structure, mutable vs immutable data structures), including performance and other considerations. My prior common lisp exper

Re: Why does re-matcher return a mutable object?

2012-11-14 Thread Andy Fingerhut
I didn't design the API, but my guess would be that re-matcher, re-find, and re-groups are a thin wrapper around what the Java libraries provide in the way of regex matching, and to do so they make the mutable Matcher object visible to the caller. Reimplementing regex matching code from scratch

Re: Why does re-matcher return a mutable object?

2012-11-14 Thread Softaddicts
Clojure reuses some underlying types from the environment it runs into. On the JVM, strings are Java string objects, regular expressions happen to be Java regular expressions. It also reuses primitives types natively handled by the JVM. This is done for two reasons, efficiency and smoother inter

Re: Where did the idea of metadata come from?

2012-11-14 Thread Takahiro Hozumi
Paul, Raoul, David, Mimmo, JvJ, Thanks for use cases. I have better understanding now. Cheers, - Takahiro On Nov 14, 12:56 am, Paul deGrandis wrote: > Here's one use case: > > Let's say you want to develop a library that monitors system behavior and > resources while functions are executed (or w

Why does re-matcher return a mutable object?

2012-11-14 Thread Jon Degenhardt
I've recently been looking at Clojure, still trying to understand the key ideas. I went to write some regex code, and was surprised to see that re-matcher returns a mutable object. I am curious about this. It could simply be that creating an immutable version is low on the priority list. Or, it

Re: Where did the idea of metadata come from?

2012-11-14 Thread JvJ
Basically, any time you're part way through implementing some feature and you realize you need to carry along extra data with something, but you don't want to change the data you return, use metadata. For example, I was working with creating a rule system that needed to convert certain Clojure

Re: run-jetty doesn't shut down the server after ctrl+c?

2012-11-14 Thread Satoru Logic
On Wednesday, November 14, 2012 10:36:38 PM UTC+8, David Powell wrote: > > Are you using lein repl? > > lein has two processes, one for the repl, and one for the application. In > my experience, on Windows, ctrl-C -ing a lein repl is supposed to terminate > the the application, but usually doe

Re: core.match - how to simplify patterns with repeated guards

2012-11-14 Thread David Jagoe
Hey Carlo, Excellent, thank you very much! I haven't tried it yet but it looks good. Cheers, David On 15 November 2012 00:20, Carlo Zancanaro wrote: > Hey David, > > > I guess its got something to do with the fact that match itself is a > macro? > > Correct. The match macro just takes the li

Re: core.match - how to simplify patterns with repeated guards

2012-11-14 Thread Carlo Zancanaro
Hey David, > I guess its got something to do with the fact that match itself is a macro? Correct. The match macro just takes the list `(!nil? a)`, which isn't a valid match form, so it complains about it. > Is there some other way that I could extend match to only match when the > variable is n

Re: Quil equivalent for ClojureScript ?

2012-11-14 Thread Kevin Ilchmann Jørgensen
Well, i had actually expected quil to already handle it. Naively i thought it would be simple to warp the javascript library, or that the cloju-pde compiler was just around the corner. /Kevin On Wed, Nov 14, 2012 at 11:44 PM, Laurent PETIT wrote: > Good to know there exists Processing.js, the e

Re: [ANN] moderns-cljs tutorial 6

2012-11-14 Thread Mimmo Cosenza
On Wednesday, November 14, 2012 10:24:42 PM UTC+1, Casper Clausen wrote: > I just want to chime in and say good work. This exactly what I have been > looking for as a gentle introduction to clojurescript. thanks so much Casper > > If I can make one suggestion, it would be nice to have each ch

Re: Quil equivalent for ClojureScript ?

2012-11-14 Thread Mayank Jain
On Thu, Nov 15, 2012 at 3:35 AM, Laurent PETIT wrote: > Hello, > > Is there (or what is) the equivalent of Quil for ClojureScript? > > +1 -- Regards, Mayank. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to cloju

Re: Quil equivalent for ClojureScript ?

2012-11-14 Thread Laurent PETIT
Good to know there exists Processing.js, the equivalent of Processing in Javascript \o/ So besides the wrapper mentioned in the thread and which does not seem to have been properly packaged in its library yet, are there other obvious things I have missed? :) (Don't expect me to have any valuable k

Re: Quil equivalent for ClojureScript ?

2012-11-14 Thread Kevin Ilchmann Jørgensen
Hey, Since you didn't mention processing.js - I might be stating the obviously. https://groups.google.com/forum/?fromgroups=#!topic/clojure/i-c6YCCIuHI /Kevin On Wed, Nov 14, 2012 at 11:05 PM, Laurent PETIT wrote: > Hello, > > Is there (or what is) the equivalent of Quil for ClojureScript? >

Quil equivalent for ClojureScript ?

2012-11-14 Thread Laurent PETIT
Hello, Is there (or what is) the equivalent of Quil for ClojureScript? thanks in advance, -- Laurent -- 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 ar

Re: lein 2.x not working on Mac OS X 10.7.5 -- Exception in thread "main" java.lang.ClassNotFoundException:

2012-11-14 Thread Marek Šrank
Yep, leiningen now doesn't create -main function in the default template Marek. On Wednesday, November 14, 2012 8:40:20 PM UTC+1, Alec Ramsay wrote: > > My bad: I did not have (defn -main[] (...)) defined. > > > On Wednesday, November 14, 2012 7:42:20 AM UTC-8, Alec Ramsay wrote: >> >> Thanks

Re: [ANN] moderns-cljs tutorial 6

2012-11-14 Thread Casper Clausen
I just want to chime in and say good work. This exactly what I have been looking for as a gentle introduction to clojurescript. If I can make one suggestion, it would be nice to have each chapter accompanied by a project for that chapter. It would mean a lot less copy and paste to follow along

Re: lein 2.x not working on Mac OS X 10.7.5 -- Exception in thread "main" java.lang.ClassNotFoundException:

2012-11-14 Thread Alec Ramsay
My bad: I did not have (defn -main[] (...)) defined. On Wednesday, November 14, 2012 7:42:20 AM UTC-8, Alec Ramsay wrote: > > Thanks everyone for the feedback. To rule out any hyphen / underscore > issues, I created a new project "hello". Got the same exception: > > Exception in thread "main" ja

Re: lein 2.x not working on Mac OS X 10.7.5 -- Exception in thread "main" java.lang.ClassNotFoundException:

2012-11-14 Thread Alec Ramsay
Thanks everyone for the feedback. To rule out any hyphen / underscore issues, I created a new project "hello". Got the same exception: Exception in thread "main" java.lang.ClassNotFoundException: hello.core at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessControlle

Re: core.match - how to simplify patterns with repeated guards

2012-11-14 Thread David Nolen
There's no way to make that work currently. Whether it should work requires some discussion but at the moment I'm inclined to say no. On Wednesday, November 14, 2012, David Jagoe wrote: > Hi all, > > I have a core.match pattern that looks something like this: > > (def !nil? (complement nil?)) > >

Re: [ANN] moderns-cljs tutorial 6

2012-11-14 Thread Mayank Jain
Keep sharing. Looking forward to more :) On Tue, Nov 13, 2012 at 10:11 PM, Giacomo Cosenza wrote: > Hi all, > I'm always a little bit afraid in announcing my small results as a > clojure/cljurescript newbie to such a smart community of programmers. > > I just published on github my learning effo