Re: Book for Programming Clojure

2009-04-30 Thread Timothy Pratley
Hopefully this will give you some leads also: http://en.wikibooks.org/w/index.php?title=Clojure_Programming/Further_Reading Regards, Tim. On Apr 30, 7:49 pm, anderspe wrote: > First the "Programming Clojure" by   Stuart Halloway was sad to come > April 2009, now i read > Juni, so the loong wait

Re: testing the reader...

2009-04-30 Thread Stephen C. Gilardi
On Apr 30, 2009, at 9:43 AM, Julien wrote: -here's the clojure code: (def text1 "testing thread") (def T (proxy [Thread] [] (run [] (println "T thread : (eval (println text1))") (eval (println text1)) (println "T thread : (eval (read-strin

Re: Dropping strings.

2009-04-30 Thread Krešimir Šojat
> Hum... that's not my experience, I'm at my job right now so I can't > double check this. Looking at the javadoc, it appears that if n is > larger than the string length it will throw an > IndexOutOfBoundsException. That must have been the reason why I've > written drop-str in the first place.

Re: What's the function that returns the opposite of a predicate?

2009-04-30 Thread samppi
Wonderful. I didn't think of searching for "opposite". Thanks everyone. On Apr 30, 11:25 am, "Stephen C. Gilardi" wrote: > On Apr 30, 2009, at 1:50 PM, samppi wrote: > > > I know there's a core function that takes a predicate and returns its > > opposite: > > > (defn mystery [predicate] > > (fn

Re: What's the function that returns the opposite of a predicate?

2009-04-30 Thread Stephen C. Gilardi
On Apr 30, 2009, at 1:50 PM, samppi wrote: I know there's a core function that takes a predicate and returns its opposite: (defn mystery [predicate] (fn [x] (not (predicate x I'm having a lot of trouble finding the name of it in the docs, though. Could anyone give me its name? Or does thi

Re: What's the function that returns the opposite of a predicate?

2009-04-30 Thread Parth Malwankar
On Thu, 30 Apr 2009 23:20:14 +0530, samppi wrote: > > I know there's a core function that takes a predicate and returns its > opposite: > > (defn mystery [predicate] > (fn [x] (not (predicate x > > I'm having a lot of trouble finding the name of it in the docs, > though. Could anyone give

Re: What's the function that returns the opposite of a predicate?

2009-04-30 Thread Andrew Wagner
I think maybe you want complement: http://clojure.org/api#complement On Thu, Apr 30, 2009 at 1:50 PM, samppi wrote: > > I know there's a core function that takes a predicate and returns its > opposite: > > (defn mystery [predicate] > (fn [x] (not (predicate x > > I'm having a lot of trouble

What's the function that returns the opposite of a predicate?

2009-04-30 Thread samppi
I know there's a core function that takes a predicate and returns its opposite: (defn mystery [predicate] (fn [x] (not (predicate x I'm having a lot of trouble finding the name of it in the docs, though. Could anyone give me its name? Or does this function not exist in the core? --~--~

Re: Metadata for Any Object

2009-04-30 Thread Mark Engelberg
On Thu, Apr 30, 2009 at 9:46 AM, Rich Hickey wrote: > However, there isn't a list, and metadata propagation could use an > audit. If there's a specific case where you think it should and it > doesn't please let me know. I think it just took me a while to figure out that cons does not preserve me

Re: Macro newbie: calling another macro

2009-04-30 Thread Konrad Hinsen
On Apr 30, 2009, at 17:39, samppi wrote: > I'm having trouble trying to create a macro that calls domonad with > one argument already filled in: (domonad parser-m rest-of-arguments). > parser-m is a monad defined in the same namespace. This is what I have > right now: > (defmacro complex >

Re: Metadata for Any Object

2009-04-30 Thread Rich Hickey
On Apr 30, 12:34 pm, Mark Engelberg wrote: > On Thu, Apr 30, 2009 at 6:01 AM, Rich Hickey wrote: > > Then, you need to know which operations require metadata propagation. > > That's built into the Clojure data structures but can't be retrofitted > > to arbitrary types. > > Is there a list of w

Re: Dropping strings.

2009-04-30 Thread Nicolas Buduroi
> You can use (.substring s n), if n is larger than string length it > will return a empty string. Hum... that's not my experience, I'm at my job right now so I can't double check this. Looking at the javadoc, it appears that if n is larger than the string length it will throw an IndexOutOfBounds

Re: Metadata for Any Object

2009-04-30 Thread Mark Engelberg
On Thu, Apr 30, 2009 at 6:01 AM, Rich Hickey wrote: > Then, you need to know which operations require metadata propagation. > That's built into the Clojure data structures but can't be retrofitted > to arbitrary types. Is there a list of which operations propagate metadata? I know I've been sur

Re: Macro newbie: calling another macro

2009-04-30 Thread samppi
Thanks for the help. The problem was fixed when I both removed the ~ in front of parser-m and changed ~product-expr to ~...@product-expr. Why is it, though, that parser-m should not be unquoted? If it was unquoted, would it not just pass in the value of parser-m at macro- expansion time? On Apr

Re: Macro newbie: calling another macro

2009-04-30 Thread Meikel Brandmeyer
Hi, Am 30.04.2009 um 17:39 schrieb samppi: (defmacro complex [steps & product-expr] `(domonad ~parser-m ~steps ~product-expr)) Just leave out the ~ in front of parser-m. And I'm not sure how you want to handle product-expr. Maybe a @ is also missing here. (defmacro complex [steps

Macro newbie: calling another macro

2009-04-30 Thread samppi
I'm having trouble trying to create a macro that calls domonad with one argument already filled in: (domonad parser-m rest-of-arguments). parser-m is a monad defined in the same namespace. This is what I have right now: (defmacro complex [steps & product-expr] `(domonad ~parser-m ~steps

Re: The function of clojure.contrib.accumulators

2009-04-30 Thread samppi
Okay; thanks for the answer! I understand now. On Apr 29, 11:52 pm, Konrad Hinsen wrote: > On 29.04.2009, at 21:44, samppi wrote: > > > Could someone give me a simple example of when > > clojure.contrib.accumulators is useful? Its use seems to involve > > collections (and numbers) that have the

Re: Book for Programming Clojure

2009-04-30 Thread Mark Volkmann
Make sure you read the more recently updated version at http://ociweb.com/mark/clojure/article.html. The "jnb" URL listed below has a link to the newest version near the beginning. For a list of the changes that have been made to this article since it was first released, see http://ociweb.com/mar

Re: clojure-contrib build error

2009-04-30 Thread Julien
You can try the eclipse plug in for clojure. It is easy to install and provided with its own clojure.jar and clojure-contrib.jar. here is the link: http://code.google.com/p/clojure-dev/ you will need Eclipse though. --~--~-~--~~~---~--~~ You received this message

testing the reader...

2009-04-30 Thread Julien
Hi all, I'm currently working on a small project to get started with clojure. I can't solve this problem which seem to be related to the reader. So I ran some test against it. -here's the clojure code: (def text1 "testing thread") (def T (proxy [Thread] []

Re: clojure-contrib build error

2009-04-30 Thread Julien
You can try the eclipse plug in for clojure. It is easy to install and provided with its own clojure.jar and clojure-contrib.jar. here is the link: http://code.google.com/p/clojure-dev/ you will need Eclipse though. --~--~-~--~~~---~--~~ You received this message

Re: Dropping strings.

2009-04-30 Thread kreso
Hi, > Any suggestions? You can use (.substring s n), if n is larger than string length it will return a empty string. -- Krešimir Šojat --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to th

Re: Book for Programming Clojure

2009-04-30 Thread anderspe
Thanks so mutch, this was great. Best regards Anders On 30 Apr, 15:28, Rayne wrote: > http://ociweb.com/jnb/jnbMar2009.html > > On Apr 30, 4:49 am, anderspe wrote: > > > > > First the "Programming Clojure" by   Stuart Halloway was sad to come > > April 2009, now i read > > Juni, so the loong w

Re: Git with Google Code

2009-04-30 Thread Rayne
I'm switching to ubuntu tonight anyways. Still pretty upsetting that, mentioning Git sucks on windows starts a round of "Windows sux!". :\ On Apr 29, 3:55 am, dysinger wrote: > Let me abstract that out a little for you :P > > (defn on-windows [x] >   (format "%s sucks on windows!" x)) > > On Ap

Re: Book for Programming Clojure

2009-04-30 Thread Rayne
http://ociweb.com/jnb/jnbMar2009.html On Apr 30, 4:49 am, anderspe wrote: > First the "Programming Clojure" by   Stuart Halloway was sad to come > April 2009, now i read > Juni, so the loong wait have been longer. i know there is a PDF > version, but i like to have a > book. > > I am new to

Re: clojure-contrib build error

2009-04-30 Thread Rayne
It's not really all that hard. They make it insanely easy to build. However, Clojure is still in the "new" stage. I'm pretty sure that soon enough we are going to need a new way to manage libraries instead of Clojure-contrib. On Apr 30, 5:08 am, Hubert Iwaniuk wrote: > Hi All, > > I'm newcomer t

Re: Metadata for Any Object

2009-04-30 Thread Rich Hickey
On Apr 30, 1:41 am, Laurent PETIT wrote: > Hi, > > 2009/4/30 Stuart Sierra : > > > > > On Apr 29, 5:58 pm, Stu Hood wrote: > >> Instead of attaching the metadata directly to the object, what if the > >> metadata was stored outside the object, in a global map of {object > >> metadata, > >> ...

Re: clojure-contrib build error

2009-04-30 Thread Hubert Iwaniuk
Hi Laurent, Thank you for information. It would be nice if this kind of info would be available as Featured Wiki page. Regards, Hubert. On Thu, Apr 30, 2009 at 2:33 PM, Laurent PETIT wrote: > > Hi Hubert, > > Howard Lewis Ship is maintaining a maven2 repository. See > > http://groups.googl

Re: clojure-contrib build error

2009-04-30 Thread Laurent PETIT
Hi Hubert, Howard Lewis Ship is maintaining a maven2 repository. See http://groups.google.com/group/clojure/browse_thread/thread/ee67ca7f69bc7e82/1ab62dcf4e2b33c9?lnk=gst&q=howard%2Brepository#1ab62dcf4e2b33c9 for details, Regards, -- Laurent 2009/4/30 Hubert Iwaniuk : > Hi Robert, > > I got

Re: clojure-contrib build error

2009-04-30 Thread Hubert Iwaniuk
Hi Robert, I got it running, only thing I'm saying is that it could be easier to get clojure-contrib. I'm running Linux and use Vim so Clojure Box is not really for me. Thank you, Hubert On Thu, Apr 30, 2009 at 12:54 PM, Robert Campbell wrote: > > If you're on Windows, please take a look a

Re: clojure-contrib build error

2009-04-30 Thread Robert Campbell
If you're on Windows, please take a look at Clojure Box: http://clojure.bighugh.com/ It comes with an installer which sets you up with an Emac environment running Clojure + contrib. It's everything you need to get up in running in minutes. This is the path I took when I faced similar difficulti

Re: Git with Google Code

2009-04-30 Thread Alvaro Vilanova Vidal
Soon, we will be able to use a DVCS on Google Code :) http://google-code-updates.blogspot.com/2009/04/mercurial-support-for-project-hosting.html --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post

clojure-contrib build error

2009-04-30 Thread Hubert Iwaniuk
Hi All, I'm newcomer to clojure. Downloaded clojure.jar. Decided to go with VimClojure. So I need clojure-contrib. svn co clojure-contrib, and failed to build. svn co clojure, build fine retried building clojure-contrib, went fine. It's fine by me, but I believe that is not really a good user ex

Book for Programming Clojure

2009-04-30 Thread anderspe
First the "Programming Clojure" by Stuart Halloway was sad to come April 2009, now i read Juni, so the loong wait have been longer. i know there is a PDF version, but i like to have a book. I am new to both Lisp and Clojure, but not to development. So is there an recommendation regarding b