Re: Simple clojure and contrib install, with SLIME ... ?

2010-02-12 Thread Michael Kohl
On Thu, Feb 11, 2010 at 7:59 PM, Paul Mooser wrote: > are a few things that seem to try to make this easier (like clojure- > mode's install-clojure, or ClojureX) but they also seem unable to keep > up with the speed of some of the changes that are happening (or, quite > possibly, I'm using them i

Re: Request for Feedback: Improve VimClojure's documentation

2010-02-12 Thread Jeff Rose
I have setup VimClojure on Linux, Mac and Windows successfully. (The classpath stuff is a major annoyance though, and sometimes I think I have problems with using different versions of clojure.jar.) I also get large error messages like the above though, which is extremely annoying. Especially si

Re: Request for Feedback: Improve VimClojure's documentation

2010-02-12 Thread Meikel Brandmeyer
Hi, On Feb 12, 1:06 pm, Jeff Rose wrote: > (The classpath stuff is a major annoyance though, and sometimes > I think I have problems with using different versions of clojure.jar.) This is possible. Since nailgun requires a named class I had to use gen-class which ties the compiled code relative

Re: Seattle Clojure meeting

2010-02-12 Thread Mark Tomko
Oh, man. I just moved from Seattle to Boston in December, and I miss Zoka's coffee. Have fun, everyone!Maybe we can get some of the Boston-area Clojure folks to meet up sometime. On Feb 11, 7:30 pm, Phil Hagelberg wrote: > On Fri, Feb 5, 2010 at 12:50 PM, Phil Hagelberg wrote: > > Wow, I c

Re: Help me make this more idiomatic clojure

2010-02-12 Thread Greg Bowyer
The (list) comes from my dabblings with other lisps, using a vector does make more sense and I quite like it I was unaware that, unless I am mistaken from your above code that let bindings are evaluated left to right, that is I was under the impression (incorrectly) that you could not use say vm i

Re: Request for Feedback: Improve VimClojure's documentation

2010-02-12 Thread Quzanti
I'll give the newbie perspective, which given as I did not really know what I was doing may involve several false assumptions but will provide insight into the thinking of a newbie, which may be a hard frame of mind for experts to imagine. Firstly when you are new you just want to get something wo

Clojure, Lejos, Robust and Lego Mindstorms NXT

2010-02-12 Thread kony
Hi all, some time ago I wrote a simple control library (called "Robust") for Lego Mindstorms NXT. Recently I wrote a Clojure wrapper to the Robust library so that it is possible to write simple control applications for standard Mindstorms' vehicles directly in Clojure. The Robust library together

Re: Request for Feedback: Improve VimClojure's documentation

2010-02-12 Thread Adrian Cuthbertson
I'd like to pitch in here as I think it's distressing to see (vim familiar) people abandoning clojure when it's quite possible to have an easy and very efficient working environment using just vim, vimclojure and rlwrap. I set this up 14 months ago when I started with clojure and I'd be dragged kic

Re: Help me make this more idiomatic clojure

2010-02-12 Thread CuppoJava
Yup, literal syntax for vectors are very convenient and heavily used in Clojure code. And (let) bindings are evaluated left to right. It's analogous to Scheme's let* i think? Only thing to watch out for is that (binding) bindings are not evaluated left to right. It's for performance reasons I thi

Re: Presentatie over Clojure

2010-02-12 Thread Joop Kiefte
Sorry for the 3rd post, but can someone provide some nice example-code for functional structures used in real world code? 2010/2/12 Jeff Rose > Cool! This is the most fun I've ever had practicing Dutch :-) > > As someone who used to be very skeptical towards functional programming and > Lisps,

Re: Clojure and OOP

2010-02-12 Thread Daniel Simms
On Thu, Feb 11, 2010 at 4:46 AM, HB wrote: > Since Clojure is a LISP dialect, does this mean that it doesn't > support OOP? Another answer is that ``it could be if you wanted it to be'', for example: http://s-expressions.com/2009/12/10/frumios-a-silly-object-system-for-clojure/ . -- You

How to catch exception and keep looping?

2010-02-12 Thread Konrad Kułakowski
I have a piece of code like this: (def ll ['a 'b 'c 'd]) (loop [e (first ll) f (rest ll)] (do (try (do (println e) ;; do sth with e which may throw an exception (recur (first f) (rest f))) (catch Exception _ (println "ex"))) (println "something") (re

Re: How to catch exception and keep looping?

2010-02-12 Thread Michał Kwiatkowski
2010/2/12 Konrad Kułakowski : > I have a piece of code like this: > > (def ll ['a 'b 'c 'd]) > > (loop [e (first ll) f (rest ll)] >  (do >    (try >       (do >          (println e) ;; do sth with e which may throw an exception >          (recur (first f) (rest f))) >      (catch Exception _ (print

Re: How to catch exception and keep looping?

2010-02-12 Thread Michał Marczyk
2010/2/12 Konrad Kułakowski : > (def ll ['a 'b 'c 'd]) > > (loop [e (first ll) f (rest ll)] >  (do >    (try >       (do >          (println e) ;; do sth with e which may throw an exception >          (recur (first f) (rest f))) >      (catch Exception _ (println "ex"))) >    (println "something")

Re: Multimethods vs. cond?

2010-02-12 Thread Daniel Werner
On Feb 11, 4:04 pm, Bryce wrote: > I'm wondering what the rationale is for using multimethods vs. cond, > and where it's best to use either?  Multimethods seem to be very > seldom used, usually to dispatch on type, but I can see advantages to > using data to dynamically define only the methods you

newbie question re-seq

2010-02-12 Thread Brian Wolf
Hi, This is from the book: (re-seq \w+ "the quick brown fox") -> ("the" "quick" "brown" "fox") But when I try it, these don't work: user> (re-seq \w+ "the quick brown fox") ; Evaluation aborted. clojure.lang.LispReader$ReaderException: java.lang.Exception: Unsupported character: \w+ (NO_SOU

Re: newbie question re-seq

2010-02-12 Thread Michał Marczyk
Replace \w+ with #"\w+". (#"..." is the regex literal syntax.) Sincerely, Michał -- 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: newbie question re-seq

2010-02-12 Thread Brian Wolf
Thanks, I wonder why the book doesn't use that? Michał Marczyk wrote: Replace \w+ with #"\w+". (#"..." is the regex literal syntax.) Sincerely, Michał -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clo

Re: Presentatie over Clojure

2010-02-12 Thread Joost
A Very Simple Example: (defn list-projects [request posts] (wrap request :project (text :projects) (map project-block posts) (link-to "/project/edit/" "new"))) That's a top-level view function from a (nearly) production site I'm working at right now. Note: Clean readable code. This

Help! Clojuresque build failed

2010-02-12 Thread sailormoo...@gmail.com
Hi: I am not familiar with gradle, but I cannot build clojuresque, so I cannot build clojureql. The log building clojuresque is as follows : Thanks for any help. D:\tools\clojuresque>gradle build :compileJava :compileGroovy 07:19:24.781 [main] DEBUG o.g.a.i.p.ant.AntLoggingAdapter - [ant:ant

clojure-protobuf

2010-02-12 Thread ninjudd
Hello All, I just finished version 1 of a clojure wrapper for protocol buffers: http://github.com/ninjudd/clojure-protobuf I'm using it as a data storage format for an embedded graph db I'm working on. It ends up being much faster than pr-str/read-string. If you're interested in fast serializati

Re: Help! Clojuresque build failed

2010-02-12 Thread Nicolas Buduroi
I'm not sure about this one but I'll guess that your setup can't compile Groovy scripts. I can't help you there as I didn't installed it myself. By the way, you don't need to build clojuresque, Gradle will take care of downloading it if specified as a dependency. Look at the build.gradle config fi

Re: Clojure/SLIME/Emacs questions

2010-02-12 Thread Steven E. Harris
Phil Hagelberg writes: > Upstream slime is not compatible with swank-clojure I find this not to be true at present, the stilted SLIME/Swank connection problem¹ and disabling autodoc mode notwithstanding. Footnotes: ¹ http://thread.gmane.org/gmane.comp.java.clojure.user/24894/focus=24956 --

Re: refs, agents and add-watch

2010-02-12 Thread MiltondSilva
@all: Thank you very much for the replies. My bottomless pit of ignorance must be quite annoying but, I can only hope one day to be in your position. (e.g. answering others questions) @ataggart: A different entity is supposed to change the refs when they go over/under some limit. It's just the way

Re: Seattle Clojure meeting

2010-02-12 Thread Phil Hagelberg
On Thu, Feb 11, 2010 at 4:30 PM, Phil Hagelberg wrote: > On Fri, Feb 5, 2010 at 12:50 PM, Phil Hagelberg wrote: >> Wow, I certainly was not expecting that level of response; this is great. >> >> Looks like the 11th (Thursday) is the crowd favorite. Once again, the >> location is http://bit.ly/c9j

Which do you prefer, expressing points in {:x 0, :y 0} or [0 0]?

2010-02-12 Thread Hozumi
Hi,all Although there is no right answer, vector seem to be preferred in many cases. Which do you prefer map or vector? Thanks! -- 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 pos

Re: Seattle Clojure meeting

2010-02-12 Thread Garth Sheldon-Coulson
It's great to hear the Seattle event was such a success! Mark, I agree that a Boston-area meet-up would be fun. If someone is interested in spearheading, I would be happy to support in any way I can. On Fri, Feb 12, 2010 at 7:58 AM, Mark Tomko wrote: > Oh, man. I just moved from Seattle to Bost

Re: Which do you prefer, expressing points in {:x 0, :y 0} or [0 0]?

2010-02-12 Thread Garth Sheldon-Coulson
I have confronted a similar question in the past when deciding how to label the dimensions of vectors and multidimensional arrays. My tentative conclusion is that it's best to use raw vectors. => (def v [40 41 42]) #'user/v If you need human-readable labels, build a separate index with constant

Re: Clojure/SLIME/Emacs questions

2010-02-12 Thread Ramakrishnan Muthukrishnan
On Sat, Feb 13, 2010 at 5:48 AM, Steven E. Harris wrote: > Phil Hagelberg writes: > >> Upstream slime is not compatible with swank-clojure > > I find this not to be true at present, the stilted SLIME/Swank > connection problem¹ and disabling autodoc mode notwithstanding. Yes, I too use slime ups

Re: Which do you prefer, expressing points in {:x 0, :y 0} or [0 0]?

2010-02-12 Thread Hozumi
Hi,Gaarth. Thank you for helpful advice. On 2月13日, 午後1:03, Garth Sheldon-Coulson wrote: > I have confronted a similar question in the past when deciding how to label > the dimensions of vectors and multidimensional arrays. > > My tentative conclusion is that it's best to use raw vectors. > > =>

Re: How to catch exception and keep looping?

2010-02-12 Thread Adrian Cuthbertson
Here's an idiomatic way of doing what you want; (defn lp [col] (loop [ll (seq col)] (when ll (try (let [itm (first ll)] (if (= itm 'x) (throw (IllegalArgumentException. (str itm " not supported."))) (println (str "done item: " itm

Re: Which do you prefer, expressing points in {:x 0, :y 0} or [0 0]?

2010-02-12 Thread Adrian Cuthbertson
I concur with Garth - structures like coordinates, points, etc are non-changing in their structure and hence don't need "mapped" references into their elements. Destructuring is the easy way to get at the elements; (let [[x y z] pt] ... and they can be combined in collections, arrays, etc, and mani