Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #2810

Re: Pure functions and Select[] sequential elements of list

From "Chris Degnen" <degnen@cwgsy.net>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Pure functions and Select[] sequential elements of list
Date 2011-05-30 10:35 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <irvrt1$8jf$1@smc.vnet.net> (permalink)
References <irtb73$plj$1@smc.vnet.net>

Show all headers | View raw


Paul McHale wrote:
>
> Hi,
> 
> Does anyone know of a way to use a pure function to access current
> and next element of list with uses like Select[]?  ... I.e.
> 
> mList={1,2,3,4,5,7,6,8};
> Select[mList, (#? > #??)&]
> 

I would use this:

Part[mList, 
 Flatten[Position[#1 > #2 & @@@ Partition[mList, 2, 1], True]]]



Back to comp.soft-sys.math.mathematica | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Pure functions and Select[] sequential elements of list "McHale, Paul" <Paul.McHale@excelitas.com> - 2011-05-29 11:38 +0000
  Re: Pure functions and Select[] sequential elements of list Ray Koopman <koopman@sfu.ca> - 2011-05-30 10:33 +0000
  Re: Pure functions and Select[] sequential elements of list "Chris Degnen" <degnen@cwgsy.net> - 2011-05-30 10:35 +0000

csiph-web