On Thu, Dec 23, 2010 at 7:08 PM, Benny Tsai <benny.t...@gmail.com> wrote: > On Dec 22, 11:42 am, Ken Wesson <kwess...@gmail.com> wrote: >> I don't think Clojure has that. Closest is >> >> (let [[f & rst] [1 2 3 4 5] >> l (last rst) >> m (butlast rst)] >> [f m l]) >> >> Output is [1 (2 3 4) 5] >> >> Obviously, using the last element is non-lazy. It may well be that in >> cases where you'd want to do this you might prefer another data >> representation. > > I can imagine some scenarios where it would be nice to do this to > sequences. I guess for now, if those should come up in Clojure, we'll > just have to jump through a few more hoops. Thank you Ken.
You're welcome. Sorry I couldn't be of greater help. If you want, I could throw together a quickie macro for grabbing a few items from either end of a seq. -- 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