Unless I'm missing something:

(count '("CCC" "COC" "C(=O)C"))
=> 3

Or better yet:

(count ["CCC" "COC" "C(=O)C"])
=> 3

On Fri, Nov 14, 2008 at 11:46 PM, Rajarshi <[EMAIL PROTECTED]> wrote:
>
> Hi, I've been learning Lisp using SBCL, but my complaint has been it
> was difficult for me to link it to stuff I use (such as cheminforatics
> libs). So I'm very happy to have found Clojure.
>
> However, I've been stumped trying to find out how to get the number of
> elements in a list. Currently I'm using
>
> (def smiles '("CCC", "COC", "C(=O)C"))
> (reduce (fn [x y] (+ x y)) (for [x smiles] 1))
>
> Is there a simpler way to do this?
>
> Thanks,
> Rajarshi
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to