pattern for coalescing similar adjacent items in list

2012-10-10 Thread Brian Craft
I have a long list (or seq? result of calling map) something like (a1 a2 a3 b1 b2 c1 c2 c3 c4) I need to replace adjacent items with related attributes with single elements, like (a b c) where 'a' is derived from a1 a2 a3, and so-forth. So, again, I'm not sure how to approach this in a

Re: pattern for coalescing similar adjacent items in list

2012-10-10 Thread Sean Corfield
partition-by will probably get you started - turning (a1 a2 a3 b1 b2 c1 c2 c3 c4) into ((a1 a2 a3) (b1 b2) (c1 c2 c3 c4)) - then map some function over that? On Wed, Oct 10, 2012 at 5:22 PM, Brian Craft craft.br...@gmail.com wrote: I have a long list (or seq? result of calling map) something

Re: pattern for coalescing similar adjacent items in list

2012-10-10 Thread Brian Craft
Cool, thanks! On Wednesday, October 10, 2012 5:52:54 PM UTC-7, Sean Corfield wrote: partition-by will probably get you started - turning (a1 a2 a3 b1 b2 c1 c2 c3 c4) into ((a1 a2 a3) (b1 b2) (c1 c2 c3 c4)) - then map some function over that? On Wed, Oct 10, 2012 at 5:22 PM, Brian Craft