how to learn clojure ?

2009-02-18 Thread MarisO
All documentation I've seen about clojure assumes knowledge of lisp which I dont have. --~--~-~--~~~---~--~~ 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 To

how to learn clojure ?

2009-02-18 Thread MarisO
All documentation I've seen about clojure assumes knowledge of lisp which I dont have. --~--~-~--~~~---~--~~ 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 To

Re: Emacs with Lisp and Clojure.

2011-03-24 Thread MarisO
swank-clojure is deprecated, don't use it. Instead start swank from leiningen. I found these instructions how to install clojure support in emacs http://riddell.us/ClojureSwankLeiningenWithEmacsOnLinux.html No need to use elpa with broken packages or starter-kit. Maris On Mar 24, 8:14 am, Tass

List comprehension and sets

2011-05-24 Thread MarisO
Is it possible to use list comprehension to generate a set ? For example in scala I can do: for (i <- (2 to 8).toSet[Int]) yield p(i) In clojure this (for [ x (set (range 4))] (* 4 x)) generates a list. -- You received this message because you are subscribed to the Google Groups "Clojure" gr

Re: List comprehension and sets

2011-05-24 Thread MarisO
> Does this actually yield a set in Scala? yes, it does > What is p()? A set constructor? p(i) reads i-nth element from a vector def selectRow(p: Vector[Int], i: Int) = { for (i <- (i - i % 9 to i - i % 9 + 8).toSet[Int]) yield p(i) } -- You received this message because you are subscri

Re: List comprehension and sets

2011-05-24 Thread MarisO
> (set (for [x (range 4)] (* 4 x))) > ;=> #{0 4 8 12} > > Does that help? yes, thank you. -- 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

Re: interest in STM, where can I start to get knowing well about it?

2011-05-24 Thread MarisO
STM is discussed in this book The Art of Multiprocessor Programming http://www.amazon.com/Art-Multiprocessor-Programming-Maurice-Herlihy/dp/0123705916 On May 18, 8:25 am, jaime wrote: > Hi All, > > I have interest in the implementation of STM, anyone who can suggest > where I can start to find

find first non nil element of sequence

2011-05-27 Thread MarisO
To find first defined Option in scala I do this: sol.find(_.isDefined).getOrElse(None) I managed to do the same in clojure: (some #(if (nil? %) false %) sol) Is there a better way ? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this

Re: find first non nil element of sequence

2011-05-27 Thread MarisO
there is find-first in contrib (find-first #(not (nil? %)) sol) On May 27, 3:12 pm, Meikel Brandmeyer wrote: > Hi, > > Am Freitag, 27. Mai 2011 15:56:47 UTC+2 schrieb MarisO: > > > > > To find first defined Option in scala  I do this: > > > sol.find(_.i

Re: New to Clojure -- Errors Are Frustrating

2011-08-03 Thread MarisO
(defn fac [n] (if (= n 1) 1 (* n fac (- n 1 your code tries to multiply n by function this is correct: (defn fac [n] (if (= n 1) 1 (* n (fac (- n 1) On Aug 2, 8:11 am, recurve7 wrote: > In browsing this group I see this topic has been brought up several > times over the past 3 years

reverse a sequence without reverse or rseq

2011-08-08 Thread MarisO
Do you know of any trick to reverse a sequence without reverse or rseq ? I wrote it like this: ((fn rev ([s] (rev '() s)) ([r s] (if (seq s) (rev (cons (first s) r) (rest s)) r )) ) '[1 2 3 5] ) https://gist.github.com/1132357 I wonder if it can be written more shortly. -- You recei

par branch in leiningen

2011-09-07 Thread MarisO
I would like to try pvmap and pvreduce. Do I need to build par branch of Clojure ? Is there any way I can make leiningen to use it ? Maris -- 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

Re: aquamacs, slime and clojure on OS X

2011-09-23 Thread MarisO
use this script to download everything you need for clojure development on emacs (aquamacs) git clone https://github.com/technomancy/clojure-mode.git wget -P framemove http://www.emacswiki.org/emacs/download/framemove.el wget -P paredit http://mumble.net/~campbell/emacs/paredit.el wget --no-check

Re: trouble setting up emacs

2011-10-18 Thread MarisO
run this script in your .emacs.d directory -- #!/bin/sh git clone https://github.com/technomancy/clojure-mode.git wget -P paredit http://mumble.net/~campbell/emacs/paredit.el wget http://download.savannah.gnu.org/releases/color-theme/color-the