Re: Looping idiom

2009-09-08 Thread songoku

On Sep 8, 5:39 am, Timothy Pratley  wrote:
> Yet another way :)
>
> user=> (map + (rest a) a)
> (3 5 7 9 11)

wow! i like your solution!

--~--~-~--~~~---~--~~
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 patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: Getting REPL transcript

2009-09-23 Thread songoku

> Vimclojure and emacs (on any operating system) will have at least the
> ability to copy from the REPL's history and paste elsewhere in the editor,
> but maybe not any nice way to export it to something else, like the mail
> client used to post to this list.
With emacs you can simply safe the buffer of the repl.

--~--~-~--~~~---~--~~
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 patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: PersistentStructMap Exception

2009-11-23 Thread songoku

> user=> (defstruct s1 :a :b)
> #'user/s1
> user=> (s1 1 2)

(struct s1 1 2) or (struct-map s1 :a 1 :b 2)
--> {:a 1, :b 2}

or:
(struct s1 1)
--> {:a 1, :b nil}

(struct-map s1 :b 2)
--> {:a nil, :b 2}

-- 
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 patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: How to use/refer to multiple Clojure classes

2009-12-07 Thread songoku
> It does not look like wildcarding is supported in the ns macro and it
> seems silly to explicitly nominate each class that I want to have at
> my disposal. Am I thinking about this all wrong?

As far as i know you have to add each of them...

-- 
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 patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Newbie questions about leiningen

2010-07-07 Thread songoku
> Thanks for both answers. Two ways of doing it. Great!

The :jvm-opts "-Xmx1g" -option in the project-file doesnt seem to work
with the swank-server.

-- 
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 patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: First function

2010-10-21 Thread songoku
You should close the parenthesis all in one line:

(defn binary-search
"Search sorted list for target using binary search technique"
([m_list target]
(if (empty? m_list)
false
(binary-search m_list 0 (- (count m_list) 1) target)))
([m_list m_left m_right target]
(let [gap (- m_right m_left)]
(if (>= 0 gap)
(if (== (nth m_list m_left) target)
(nth m_list m_left)
false)
(let [middle (+ m_left (quot gap 2))]
(if (== (nth m_list middle) target)
(nth m_list middle)
(if (< target (nth m_list middle))
(recur m_list m_left (- middle 1) target)
(recur m_list (+ middle 1) m_right
target

It safes some space ;)

-- 
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 patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en