Re: sequence question and style question

2008-11-05 Thread Graham Fawcett
On Wed, Nov 5, 2008 at 2:00 PM, Stuart Halloway <[EMAIL PROTECTED]> wrote: > > Duh. Thanks, and I will be adding that to the sequences chapter. :-/ > > Stuart You're welcome -- looking forward to the book! Best, Graham > >> >> On Wed, Nov 5, 2008 at 12:56 PM, Stuart Halloway >> <[EMAIL PROTECT

Re: sequence question and style question

2008-11-05 Thread Stuart Halloway
Duh. Thanks, and I will be adding that to the sequences chapter. :-/ Stuart > > On Wed, Nov 5, 2008 at 12:56 PM, Stuart Halloway > <[EMAIL PROTECTED]> wrote: >> >> (1) Is there a simpler way to define pairwise, which takes an >> existing >> sequence and then returns its items a pair at a time?

Re: sequence question and style question

2008-11-05 Thread Graham Fawcett
On Wed, Nov 5, 2008 at 12:56 PM, Stuart Halloway <[EMAIL PROTECTED]> wrote: > > (1) Is there a simpler way to define pairwise, which takes an existing > sequence and then returns its items a pair at a time? > > (defn pairwise [& seq] > (map vector (take-nth 2 seq) (take-nth 2 (rest seq The b