Jeff Gross wrote:
> I have a vector that I need to count the size of and do a simple math
> calculation with.
> Say for example:
> (defn vect1 [1 2 3 4])
> 
> Typing (count vect1) returns the size of 4 that I need. I thought that
> I could simply use (count vect1) in an a simple infix expression, ie:
> (* (count vect1) 5)    however, I get a class cast exception error
> that the java.lang.integer cannot be cast to clojure.lang.ifn. How
> would I go about doing this correctly?

I don't know why it's not working for you. The following works perfectly
fine for me:

(def vect1 [1 2 3 4])
(count vect1)
(* (count vect1) 5)

Are you sure you used def and now defn while defining vect1?

Regards,
BG

-- 
Baishampayan Ghose <b.gh...@ocricket.com>
oCricket.com

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to