I think I get the difference now between a sequence, list, and a vector. Thanks 
for the quick answers. 

On Jun 20, 2013, at 5:14 PM, "John D. Hume" <duelin.mark...@gmail.com> wrote:

> On Jun 20, 2013 3:11 PM, "Jason Gilman" <jason.gil...@gmail.com> wrote:
> >
> > (defn bar [my-list n]
> >   (if (= n 0)
> >       (peek my-list)
> >       (bar (rest my-list) (dec n))))
> > (bar [1 2 3] 1)
> >
> 
> It seems likely you want either first and rest* (to work from the front of 
> any seqable) or peek and pop (to work from the back of a vector or the front 
> of a list or queue). Combining peek and rest on a vector as the bar function 
> does makes no sense, since they work at opposite ends.
> 
> *or next in place of rest.
> 
> -- 
> -- 
> 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
> --- 
> You received this message because you are subscribed to a topic in the Google 
> Groups "Clojure" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/clojure/7DzLLsmnm-E/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to