awesome dude!!! Thanks for the book recommendation...I'll take a look
at those when I can. Right now I am just eager to get my code
working ;)
On Oct 27, 1:18 pm, Aravindh Johendran wrote:
> On Oct 27, 8:24 am, Glen Rubin wrote:
>
> > wow, i think you just went way over my head. First off a v
wow, i think you just went way over my head. First off a very naive
question: I thought all clojure programming was functional, as long as
you are not using refs, agents, or other mutable values etc...??
On Oct 27, 12:26 am, Aravindh Johendran wrote:
> What kind of an answer are you looking
What kind of an answer are you looking for? Just the quickest way to
do it? Do you want an "idiomatic" clojure solution or are you learning
functional programming using clojure? There are many ways to do this.
Others have provided cool solutions.
Here's a way of doing it if you are interested in f
Is it ok if the index starts at 0?
(use '[clojure.contrib.seq :only (indexed)])
(defn get-min-and-index [coll]
(apply min-key #(second (second %)) (indexed coll)))
user=> (get-min-and-index [[22 5] [56 8] [99 3] [43 76]])
[2 [99 3]]
On Oct 26, 7:54 pm, Glen Rubin wrote:
> I have a sequence l
On 27 October 2010 12:54, Glen Rubin wrote:
> I have a sequence like this:
>
> [ [a b] [a b] [a b] [a b] ]
>
> where a and b are numbers. I would like to return the vector and its
> index for which b is the least in this collection.
>
> For example, if my data is as follows
>
> [ [22 5] [56 8] [
I have a sequence like this:
[ [a b] [a b] [a b] [a b] ]
where a and b are numbers. I would like to return the vector and its
index for which b is the least in this collection.
For example, if my data is as follows
[ [22 5] [56 8] [99 3] [43 76] ]
I would like to return 3rd vector in the coll