Re: indexing only some elements of a sequence...

2010-03-21 Thread Douglas Philips
On 2010 Mar 20, at 10:40 AM, Steve Purcell wrote: Which looks the same as clojure.contrib.seq/reductions to me... On 20 Mar 2010, at 13:54, Per Vognsen wrote: Learn to love scan: http://gist.github.com/338682 Thanks Per and Steve! I knew there was catch that I wasn't seeing. I did see red

Re: indexing only some elements of a sequence...

2010-03-20 Thread Per Vognsen
One last thing: On Sat, Mar 20, 2010 at 10:16 PM, Meikel Brandmeyer wrote: > Hi, > > On Sat, Mar 20, 2010 at 09:50:12PM +0700, Per Vognsen wrote: >> Aha! I Googled for scan in seq-utils and didn't find anything. It >> would be nice if people stuck to standard terminology that has a >> continuous

Re: indexing only some elements of a sequence...

2010-03-20 Thread Per Vognsen
Yeah, I was being a bit too glib. One of my favorite things about Clojure is definitely what you mention. As for the matter at hand, the name 'reductions' is perhaps more descriptive but the con is that it less standard and almost three times as long as 'scan'. The importance of descriptiveness in

Re: indexing only some elements of a sequence...

2010-03-20 Thread Meikel Brandmeyer
Hi, On Sat, Mar 20, 2010 at 09:50:12PM +0700, Per Vognsen wrote: > Aha! I Googled for scan in seq-utils and didn't find anything. It > would be nice if people stuck to standard terminology that has a > continuous history going back to the early 60s. So we use names like car and cdr? This is one o

Re: indexing only some elements of a sequence...

2010-03-20 Thread Per Vognsen
Aha! I Googled for scan in seq-utils and didn't find anything. It would be nice if people stuck to standard terminology that has a continuous history going back to the early 60s. -Per On Sat, Mar 20, 2010 at 9:40 PM, Steve Purcell wrote: > Which looks the same as clojure.contrib.seq/reductions t

Re: indexing only some elements of a sequence...

2010-03-20 Thread Steve Purcell
Which looks the same as clojure.contrib.seq/reductions to me... -Steve On 20 Mar 2010, at 13:54, Per Vognsen wrote: > Learn to love scan: http://gist.github.com/338682 > > -Per > > On Sat, Mar 20, 2010 at 12:13 PM, Douglas Philips wrote: >> Hello all, >> I'm new to clojure, but not lisp. >

Re: indexing only some elements of a sequence...

2010-03-20 Thread Per Vognsen
Learn to love scan: http://gist.github.com/338682 -Per On Sat, Mar 20, 2010 at 12:13 PM, Douglas Philips wrote: > Hello all, >   I'm new to clojure, but not lisp. >   I'm looking for a functional way to index/number only some items of a > list. > >   For example, I know I can do this (indexed is

indexing only some elements of a sequence...

2010-03-20 Thread Douglas Philips
Hello all, I'm new to clojure, but not lisp. I'm looking for a functional way to index/number only some items of a list. For example, I know I can do this (indexed is from the contrib seq_utils library): (using a short example to keep it rea