[Tutor] extracting elements in a sequence

Tim Johnson tim@johnsons-web.com
Sun Feb 9 16:05:52 2003


* Sean 'Shaleh' Perry <shalehperry@attbi.com> [030209 09:36]:
> On Sunday 09 February 2003 09:34, Tim Johnson wrote:
> > Hello All:
> >     Is there a builtin way to extract elements in a series
> > as in
> > test = [1,'one',2,'two',3,'three']
> > extract(test,2)
> > = [1,2,3]
> > or extract(test,3)
> > = [1,'two']
> > If so, pointers to documentation would be appreciated.
> 
> eh? uh? what?
> 
> why does extract(test, 2) return [1,2,3]?  This example just does not parse 
> for me.

 Sorry to confuse you. Perhaps you would choose a better word.

 You see the results: One would iterate through the collection,

 taking (if 2 the first of two, if 3 the first of 3, etc.)
 I used the word 'extract' because I'm coming from a different
 language....

 HTH
-- 
Tim Johnson <tim@johnsons-web.com>
      http://www.alaska-internet-solutions.com
      http://www.johnsons-web.com