Hi!
I've been working on a script and I don't understand what this error means.
My function, takes a number (id) and extract the first element of a list in my vector.
Details :
My function :
(defn getnameonly [number]
(doall (nth (
(nth
(filter #(= number (first %)) customers)
0)
1)
0))
)
where customers is :
(
[1 (John Smith 123 Here Street 456-4567)]
[2 (Sue Jones 43 Rose Court Street 345-7867)]
[3 (Fan Yuhong 165 Happy Lane 345-4533)]
)
So basically, I want to pull out (return value) "John Smith" if I give 1 to my function.
The code :
(nth (
(nth
(filter #(= number (first %)) customers)
0)
1)
0))
works fine outside the function. However, when I call :
(println getnameonly 1)
I get :
#object[db$getnameonly 0x66908383 db$getnameonly@66908383] 1
Any idea why and how to solve this issue?